diff template for diff category

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

diff template for diff category

Post by MySchizoBuddy »

Is it possible to change the template based on which category the viewer is on.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: diff template for diff category

Post by garvinhicking »

Yes, by writing a plugin.

Using the "frontend_configure" hook you can do:

Code: Select all

if ($serendipity['GET']['category'] == 2) {
  $serendipity['template'] = 'template1';
} elseif ($serendipity['GET']['category'] == 3) {
  $serendipity['template'] = 'template2';
}
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply