Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Variable content in theme  (Read 3982 times)

0 Members and 1 Guest are viewing this topic.

dad6b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Variable content in theme
« 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?
Logged

Nibbler

  • Guest
Re: Variable content in theme
« Reply #1 on: December 30, 2004, 06:07:08 pm »

You can use anycontent.php for this.
Logged

dad6b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Variable content in theme
« Reply #2 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?
Logged

Nibbler

  • Guest
Re: Variable content in theme
« Reply #3 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.
Logged

dad6b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Variable content in theme
« Reply #4 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?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Variable content in theme
« Reply #5 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.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.