forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: dad6b on December 30, 2004, 05:33:27 pm

Title: Variable content in theme
Post by: dad6b on December 30, 2004, 05:33:27 pm
I would like to vary what part of my theme is displayed based on what the user is looking at.  For example, if the user is at the main gallery page I would like a little welcome message but once they enter a specific album that message should go away.

I tried modifying my theme.php file to check if the album variable was set but that didn't seem to work.  Any suggestions?
Title: Re: Variable content in theme
Post by: Nibbler on December 30, 2004, 06:07:08 pm
You can use anycontent.php for this.
Title: Re: Variable content in theme
Post by: dad6b on January 03, 2005, 04:26:32 pm
The part I'm looking to vary is a side bar which has a menu for non-cpg stuff.  I don't think I can do with the anycontent.php.  Is there a way to do this by hacking some of the cpg files?
Title: Re: Variable content in theme
Post by: Nibbler on January 03, 2005, 04:52:15 pm
If it's an html menu that can go in your theme's template.html, otherwise treat it as a custom header/footer.
Title: Re: Variable content in theme
Post by: dad6b on January 03, 2005, 05:41:28 pm
I know I can just put the code for the menu in the template.html file, but how do I control whether or not it should be displayed?
Title: Re: Variable content in theme
Post by: kegobeer on January 03, 2005, 06:31:23 pm
You'll have to modify theme.php to add your side menu, and use an if-then block to determine if it should be displayed.  If you search the forums you will find good posts on how to modify a theme.