Page 1 of 1

Frontpage conponent

Posted: Fri Jul 28, 2006 2:05 pm
by zz_james
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

Re: Frontpage conponent

Posted: Fri Jul 28, 2006 3:00 pm
by zz_james
dont worry I found it!

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

James

Re: Frontpage conponent

Posted: Fri Jul 28, 2006 3:03 pm
by zz_james
Oh no! that's wrong!

the question still stands!

Re: Frontpage conponent

Posted: Fri Jul 28, 2006 3:25 pm
by friesengeist
Joomla! 1.5: \components\com_frontpage\view\blog\blog.html.php
Joomla! 1.0: \components\com_content\content.html.php

:-)

Re: Frontpage conponent

Posted: Fri Jul 28, 2006 4:01 pm
by zz_james
heh. yes I actually just find it...

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

thanks

James

Re: Frontpage conponent

Posted: Sat Aug 05, 2006 9:41 am
by zz_james
the result is


only home page done so far!

Re: Frontpage conponent

Posted: Sat Aug 05, 2006 10:02 am
by eyezberg
Very nice. I wish this was included in 1.5..
Please upload your hack :)

Re: Frontpage conponent

Posted: Fri Aug 11, 2006 11:26 am
by zz_james
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

Re: Frontpage conponent

Posted: Sat Aug 19, 2006 11:14 pm
by ianmac
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

Re: Frontpage conponent

Posted: Sun Aug 20, 2006 5:08 pm
by zz_james
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!!!

Re: Frontpage conponent

Posted: Thu Aug 24, 2006 4:51 pm
by ianmac
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

Re: Frontpage conponent

Posted: Mon Sep 18, 2006 10:13 pm
by tj.baker
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

Re: Frontpage conponent

Posted: Fri Oct 13, 2006 11:50 am
by ChuckTrukk
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

Re: Frontpage conponent

Posted: Sat Feb 17, 2007 7:22 pm
by corrado444
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

Re: Frontpage conponent

Posted: Wed Feb 28, 2007 8:31 am
by ianmac
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