Jul 29, 2005, 3:57 AM
Veteran / Moderator (6956 posts)
Jul 29, 2005, 3:57 AM
Post #5 of 6
Views: 2831
I think I posted this before, but the solution I found that works "best" for me, is to add _home to the various segments of the home template, and duplicate the include files, such as:
include_right_sidebar_home.html
Because the home page, detail pages, and often search/new/cool pages are formatted differently from the "category" pages, I've also created the same sort of region files for each.
include_right_sidebar.html is the "default" file.
The other sidebar files can be customized, or left empty, or simply <%include include_right_sidebar.html%>
Editing the .css file to give different formatting to those regions gives you some extra control as well.
I have found this works *best* for us, because when I'm trying to make a change to the site, I can easily and visually find the include_right_sidebar_NNNNN.html file, and the related .css block. Any changes to that one block will not affect the others, but changes to the default formatting affect all the blocks.
I've also found it helpful to separate out many of the home page regions, and create new <div> or other blocks using the _home extension to the tags.
That way, I can have a different formatting on the home page, and another format for the site-wide pages.
I've found it less confusing than trying to use nested if/else or other constructs for this particular situation.
This is -different- than trying to show different content or formatting based on topics (eg: modifying a single template to do different things). This is formatting by _region_ (page, page-block, content-block), and creating different regions and named blocks makes a lot of sense when you think about how you "visualize" or conceptualize your site layout.
I'm sure there are clever ways of using the page-name tag and if/else blocks to append the formatting tags, but that is overkill for what I needed. In setting up about 20-25 sites with GL3, and converting another couple of dozen sites, separating out the _home page/blocks from the rest of the site covered over 90% of the formatting situations we've run into. _search is over half the other situations, since customized search results and 3rd party pull results are often used, so different formatting is needed.
In short: using if/else blocks to load different content based on _template_ is not as good a solution as using them within a template to simply load different content (eg: categories, topics, themes). We've found it better to modify the base templates, then use default <%include ...%> to load default content. It's worked out as easier to maintain. Since the major templates (home, category, link, xxx_sidebar, headers, etc) are going to be modified and stored in the local folder anyway, and the luna.css is preserved through upgrades, it doesn't impose any additional burdon, and actually makes "thinking" about the site's layout easier (*especially* if you are setting up or maintaining multiple sites).
Just a few side-ways thoughts :)
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.