Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Create a switch for template.html  (Read 3248 times)

0 Members and 1 Guest are viewing this topic.

Zuker

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Create a switch for template.html
« 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!
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Create a switch for template.html
« Reply #1 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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Create a switch for template.html
« Reply #2 on: June 15, 2008, 03:28:31 pm »

i mean something like

Code: [Select]
<!-- 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


Logged

Zuker

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Create a switch for template.html
« Reply #3 on: June 18, 2008, 12:12:44 am »

any ideas ? :'(
Logged

Raven24

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 25
Re: Create a switch for template.html
« Reply #4 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:
Code: [Select]
// 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 ;-)
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.