Page 1 of 1
Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 6:42 pm
by user1234
Hi,
possibly I just have tomatoes for eyes, but I can't find it. Is there a way that I can assign different themes to certain (static) pages and to categories? I don't mean templates, I really mean themes.
Cheers
Dachs
Re: Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 7:22 pm
by Don Chambers
Need to be careful with vocabulary. For the most part, theme, template, and styles are used interchangeably. The exception is when discussing smarty template files (*.tpl).
There is a plugin called properties/templates of categories which allows different categories to use different themes. Static pages, however, have no way to be associated with a specific category, although such a feature has been on the wish list for a long time. Unfortunately, nobody with that skillset has found the time to implement the feature.
Re: Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 7:27 pm
by garvinhicking
Hi DOn!
Actually, categories can be associated with staticpages! There's even a readme file in it.
Changing the look for a staticpage side wouldn't also be too hard. You can already use custom template files for each staticpage, which usually only controlls the "inner" look of a page.
BUT you can change your index.tpl file so by checking {if $staticpage_pagetitle != ''}...{/if} to only make your blog output the framework/body part of a page if NO staticpage is chosen. This way, you can put ALL of the HTML framework inside a single static page (by thus defeating the reason of static pages though, because you could better write up a static .html page now

)
HTH,
GArvin
Re: Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 7:46 pm
by user1234
Hi,
okay - to explain this:
1. Static pages show sidebar - sidebar changes depending on which staticpage is called (when static page A is chosen, sidebar A is shown and stays relevant through all childpages under A, staticpage B is chosen, sidebar B is shown and stays relevant through all childpages under B, etc etc)
2. News/Blog section - no sidebar and uses full width of theme
Any ideas how this could be done?
Cheers
Dachs
Re: Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 8:56 pm
by garvinhicking
Hi!
To do this, you can setup multiple sidebars A, B, C etc. (using a templates config.inc.php, like some themese do -- $serendipity['sidebars']). Then inside index.tpl where serendipity_printSidebar is used, do a check for which staticpage is called ({if $staticpage_pagetitle == 'XXX'}...sidebar A...{elseif...}). Alternatively, you could even use custom staticpage fields to set a special variable to A, B, C etc. and abstract that furthermore, and not put a name check in index.tpl. This is definitely possible, but such customization comes at a price of writing the conditional clauses into your template(s).
HTH,
Garvin
Re: Assign specific them to static pages/categories
Posted: Mon Jan 25, 2010 9:10 pm
by Don Chambers
garvinhicking wrote: Alternatively, you could even use custom staticpage fields to set a special variable to A, B, C etc. and abstract that furthermore, and not put a name check in index.tpl.
This is how I would probably approach it too with the new static page functionality.
If the content does not have to be a true static page item, but something that could just be maintained in index.tpl, I would do the logic there, do the logic test for certain static pages, emit what I needed, then call the usual sidebars..