Frontpage conponent
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Frontpage conponent
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
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
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
dont worry I found it!
/home/james/public_html/cooltan/administrator/components/com_frontpage/frontpage.xml
James
/home/james/public_html/cooltan/administrator/components/com_frontpage/frontpage.xml
James
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
Oh no! that's wrong!
the question still stands!
the question still stands!
-
- Joomla! Guru
- Posts: 842
- Joined: Sat Sep 10, 2005 10:31 pm
Re: Frontpage conponent
Joomla! 1.5: \components\com_frontpage\view\blog\blog.html.php
Joomla! 1.0: \components\com_content\content.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
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
heh. yes I actually just find it...
line 456 of content.html.php is what I am looking for to be exact!!
thanks
James
line 456 of content.html.php is what I am looking for to be exact!!
thanks
James
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
the result is
only home page done so far!
only home page done so far!
- eyezberg
- Joomla! Hero
- Posts: 2859
- Joined: Thu Aug 25, 2005 5:48 pm
- Location: Geneva mostly
- Contact:
Re: Frontpage conponent
Very nice. I wish this was included in 1.5..
Please upload your hack
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
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
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
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
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
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: Frontpage conponent
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
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
-
- Joomla! Apprentice
- Posts: 12
- Joined: Thu Jul 27, 2006 7:30 pm
Re: Frontpage conponent
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!!!
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!!!
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: Frontpage conponent
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
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
- tj.baker
- Joomla! Enthusiast
- Posts: 231
- Joined: Tue Feb 14, 2006 6:23 am
Re: Frontpage conponent
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
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.
- ChuckTrukk
- Joomla! Enthusiast
- Posts: 216
- Joined: Tue Aug 23, 2005 4:34 pm
- Location: Mt. Juliet, Tennessee
- Contact:
Re: Frontpage conponent
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
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
- corrado444
- Joomla! Guru
- Posts: 860
- Joined: Thu Jul 06, 2006 8:30 am
- Location: Sacramento
- Contact:
Re: Frontpage conponent
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
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
Itunes: [url]itpc://10minutejoomlatips.blip.tv/rss/itunes[/url]
Feedburner http://feeds.feedburner.com/10MinutesJoomlaTips
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: Frontpage conponent
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
Forum member Absalom has done some work on this for 1.0. You might try getting in touch with him.
Ian