Create a switch for template.html Create a switch for template.html
 

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

Main Menu

Create a switch for template.html

Started by Zuker, June 15, 2008, 07:09:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zuker

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!

just_some_guy

What do you mean by a "switch"?

If you create a right-side menu in template.html it will appear on all Coppermine pages.
Tambien, Hablo EspaƱol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Zuker

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



Zuker


Raven24

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