coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Zuker on June 15, 2008, 07:09:09 AM

Title: Create a switch for template.html
Post by: Zuker on June 15, 2008, 07:09:09 AM
Hi!

i'm trying to create a right-side menu for my template.

The problem it's that i want to show it on all pages instead displayimage.php, so i was thinking of creating a switch, and place it on template.html.

but i dunno where to create that switch (of if there it's a better way of doing it)

thanks in advance!
Title: Re: Create a switch for template.html
Post by: just_some_guy on June 15, 2008, 11:10:07 AM
What do you mean by a "switch"?

If you create a right-side menu in template.html it will appear on all Coppermine pages.
Title: Re: Create a switch for template.html
Post by: Zuker on June 15, 2008, 03:28:31 PM
i mean something like

<!-- BEGIN switch_right_menu -->
code of the right menu
<!-- END switch_right_menu -->


is it possible? would you recommend another way of doing it?

thanks in advance


Title: Re: Create a switch for template.html
Post by: Zuker on June 18, 2008, 12:12:44 AM
any ideas ? :'(
Title: Re: Create a switch for template.html
Post by: Raven24 on June 18, 2008, 04:25:07 AM
If I understand you correctly you would have to modify your theme.php and the template.html and your stylesheet (at least I would do it like that)

look for the "pageheader" function in your theme.php. if you can't find it, copy it from the themes/sample/theme.php
now you can put an if-clause in the pageheader-function before the "echo template_eval($template_header, $template_vars);" like:
// if the current page is not displayimage.php
if ( !strstr($_SERVER['SCRIPT_NAME'], 'displayimage.php')) {
  // your navigation
  $nav_code = '<div class="nav">....<div>';
  $template_vars['{SIDENAV}'] = $nav_code;
} else {
  // if the current page is displayimage.php
  $template_vars['{SIDENAV}'] = '';
}


then you have to put a {SIDENAV} marker in your template.html. a good position would probably be before the main table. with a little css float (-> google) for the classname "nav" (as used in the if-clause) you can position your navigation.
I am not 100% sure if that works but you can give it a try ;-)