diff template for diff category

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

diff template for diff category

Post by MySchizoBuddy » Mon Jul 04, 2005 5:12 am

Is it possible to change the template based on which category the viewer is on.

User avatar
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Re: diff template for diff category

Post by garvinhicking » Mon Jul 04, 2005 9:41 am

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';

# 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