Is there a way to change the banner depending on which category you are in? (ex: if I have cats, dogs, etc for my categories, I have an image of a cat for my cats category, and dog for my dogs category)
TIA
changing banner based on category
-
- Regular
- Posts: 450
- Joined: Thu May 26, 2005 10:43 am
- Location: Bonn, Germany
- Contact:
in version 0.9 (under development) you can use a plugin to change the template for every category. you could just use different headers if you want to.
you can try it, using the latest nightly built here. While under development, its running stable.
The plugin is "categorytemplates". read more about it here and theres a new version of the plugin, read more here
I dont know if theres another way. There might be.
you can try it, using the latest nightly built here. While under development, its running stable.
The plugin is "categorytemplates". read more about it here and theres a new version of the plugin, read more here
I dont know if theres another way. There might be.
Marc
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Whil what Col. Kurz explained is perfectly right (thanks), there also is a way to make this special banner-only change work in Serendipity 0.8
Take your index.tpl template and locate this code:
change this to:
Then create a file "config.inc.php" inside your template directory with this content:
Third and last, edit your style.css file and locate the "#serendipity_banner" snippet. Now copy that to "#serendipity_banner1", "#serendipity_banner2" and so on, for each categoryid and change the Image/Style for that.
Regards,
Garvin
Take your index.tpl template and locate this code:
Code: Select all
<div id="serendipity_banner">
<h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default
<h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@defa
</div>
Code: Select all
<div id="serendipity_banner{$categoryid}">
<h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default
<h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@defa
</div>
Code: Select all
<?php
$serendipity['smarty']->assign('categoryid', $serendipity['GET']['category']);
?>
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/
# 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/