Frontpage conponent

A general technical discussion area for patTemplate.
Locked
zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Frontpage conponent

Post by zz_james » Fri Jul 28, 2006 2:05 pm

Hi

Searched around a bit and from what I can gather the frontpage module doesn't use a single output template file for display, is this right?

so I needs to do something quite simple, which is wrap each 'content item' in a couple of div tags so I can style them - shouldn't be too hard if there is a loop then I can just base a style name on the counter i.e. "> sort of thing.

but I cannot locate the file which generates the frontpage table.... I am experienced PHP coder so even if it is somewhere in the core I can handle it but would just like to know roughly where to look.... any clues?

Thanks

James

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Fri Jul 28, 2006 3:00 pm

dont worry I found it!

/home/james/public_html/cooltan/administrator/components/com_frontpage/frontpage.xml

James

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Fri Jul 28, 2006 3:03 pm

Oh no! that's wrong!

the question still stands!

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: Frontpage conponent

Post by friesengeist » Fri Jul 28, 2006 3:25 pm

Joomla! 1.5: \components\com_frontpage\view\blog\blog.html.php
Joomla! 1.0: \components\com_content\content.html.php

:-)
We may not be able to control the wind, but we can always adjust our sails

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Fri Jul 28, 2006 4:01 pm

heh. yes I actually just find it...

line 456 of content.html.php is what I am looking for to be exact!!

thanks

James

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Sat Aug 05, 2006 9:41 am

the result is


only home page done so far!

User avatar
eyezberg
Joomla! Hero
Joomla! Hero
Posts: 2859
Joined: Thu Aug 25, 2005 5:48 pm
Location: Geneva mostly
Contact:

Re: Frontpage conponent

Post by eyezberg » Sat Aug 05, 2006 10:02 am

Very nice. I wish this was included in 1.5..
Please upload your hack :)
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.[URL banned].com for J! 1.5 screenshots
http://www.eyezberg.com

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Fri Aug 11, 2006 11:26 am

well I am not so proud as to make a fuss, this hack may be not suitable for many.

I have it set so that my frontpages and interior pages use seperate template (template manager/assign) doing this allowed me to edit the file

\components\com_content\content.html.php

between lines 456 and 457

">

then I can generate a style name and style it in the CSS. Because the internal pages use a different template I have not defined the style on the internal pages, thus overcoming the problem the changes being global (I only wanted it on the front page)

There are a number of ways of generating the unique ID such as by order on the page, category or section etc. I chose to have the item background be colour coded depending on what section ID the item belong to, so you can insert on the line before the new line at 456:

$unique_id = $row->sectionid;

now items in section id 1 will be surrounded by div tags and syle sheet can contain

.itemstyle1{background: .... etc}

you can of course use section name if it makes more sense.

The problem is of course adding new sections requires a new style definition, but in my case this is unlikely to happen.

with imagination different ideas are possible such as colouring due to page order just to 'spruce up' design and make it seem more lively, here are some possible variable names to base unique_id on:

$row->id
$row->sectionid
$row->catid
$row->created_by
$row->author
$row->section
$row->category


or of course just a limited random integer, say random of 5, and then 5 styles but random colouring sometimes confuse the user!

so all in all, nice but with limitations in practice!

thanks

James

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Frontpage conponent

Post by ianmac » Sat Aug 19, 2006 11:14 pm

I would encourage you not to edit the core files.  Instead, there is an alternative... you should be able to add a new file to the template which will override the the original html.php file.

So all you need to do is add the new content.html.php file to the template, and this will avoid having to hack the core.

Ian

zz_james
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 27, 2006 7:30 pm

Re: Frontpage conponent

Post by zz_james » Sun Aug 20, 2006 5:08 pm

HI

Thanks, I'm happy to accept that what I did is not recommended.

I don't understand your advice at the moment, hopefully I will learn what you mean as I begin to develop my Joomla development vocabulary.

Thanks again

James

p.s. I was under the impression from gossip that in Joomla 1.0 there is no frontpage template file, rumour was it was all in pieces in the core file.....any better news gratefully recieved!!!

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Frontpage conponent

Post by ianmac » Thu Aug 24, 2006 4:51 pm

I apologize, the word template can be a bit ambiguous as it can mean different things.

What I meant by template was the downloadable template packages (e.g. solarflare, madeyourweb, etc...).  In your Joomla! install, these are stored in the directory templates/madeyourweb (for example).  Instead of modifying the content.html.php file, you can put your modified version in this template directory.  Then, instead of loading the old content.html.php file, it will load the new one.  That way, if you have to upgrade your site, the file will not get overwritten.

Hope that is clearer.
Ian

User avatar
tj.baker
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 231
Joined: Tue Feb 14, 2006 6:23 am

Re: Frontpage conponent

Post by tj.baker » Mon Sep 18, 2006 10:13 pm

Can someone explain to me how to do this please?

Is it that I would edit the content.html.php file, save the edited version of the file in the template folder, and voila?   



Thanks for the input in advance....

peace,

tj
Last edited by tj.baker on Tue Sep 19, 2006 8:18 pm, edited 1 time in total.

User avatar
ChuckTrukk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 216
Joined: Tue Aug 23, 2005 4:34 pm
Location: Mt. Juliet, Tennessee
Contact:

Re: Frontpage conponent

Post by ChuckTrukk » Fri Oct 13, 2006 11:50 am

I believe you create a new subfolder in your template directory.

For example, if you are using rhuk_solarflareii, you would add a subfolders components/com_content/content.html.php
(I believe this is how it works in 1.0). I've never used it myself.

Chuck
http://www.nashville-webdesign.com - Nashville Web Design

User avatar
corrado444
Joomla! Guru
Joomla! Guru
Posts: 860
Joined: Thu Jul 06, 2006 8:30 am
Location: Sacramento
Contact:

Re: Frontpage conponent

Post by corrado444 » Sat Feb 17, 2007 7:22 pm

Interesting. I work with Zen Cart often and ZC has an override system. Now, I was reading that J 1.5 was going to have an override system but I was under the impression that 1.0.x didn't. The previous posts seem to imply that J has an override system as well working in a similar fashion to ZC.
Am I allucinationg? Does it mean that I can get rid of the content tables in my designs if I create an override as specified here?
I'll certainly give it a shot but before I invest a few hours on this project it'd be nice to have confirmation that I am not chasing windmills here.
Thank you
Watch the 10 Minute Joomla! Tips Video Podcast
Itunes: [url]itpc://10minutejoomlatips.blip.tv/rss/itunes[/url]
Feedburner http://feeds.feedburner.com/10MinutesJoomlaTips

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Frontpage conponent

Post by ianmac » Wed Feb 28, 2007 8:31 am

Well,  1.0 does have such a facility.  But the problem is not all the presentation is done in the HTML files, so some stuff doesn't come through.

Forum member Absalom has done some work on this for 1.0.  You might try getting in touch with him.

Ian


Locked

Return to “patTemplate”