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: Diffrent style only for displayimage.php for main menu and breadcumb  (Read 7257 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Can I wrapp the menu in a div and the bredcumb in a div too only on displayimage.php?

I want all the page to look black on displayimage.php and the other pages to be white including the menu.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #1 on: January 21, 2014, 10:06:41 am »

What exactly is "the menu"? Coppermine has different menus.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #2 on: January 21, 2014, 10:14:49 am »

I already said in the title,the main menu:Home Register Log in Album List
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #3 on: January 21, 2014, 10:26:54 am »

I want to wrapp the main menu in a div (class menuImage or something like this) and the breadcumb in a div (class breadImage or something like this) ONLY on displayimage.php
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #4 on: January 21, 2014, 10:31:49 am »

Home Register Log in
= sys_menu

Album List
= sub_menu

Regarding the menu, the best location seems to be in $template_sys_menu and $template_sub_menu. If it works there as expected, we can have a closer look how to display it just on displayimage.php.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #5 on: January 21, 2014, 11:27:26 am »

ok.I wrapped the ul from $template_sys_menu and is showing on all the pages.

$template_sub_menu has only $template_sub_menu = $template_sys_menu;.A div here breaks the theme.

This http://forum.coppermine-gallery.net/index.php/topic,77014.0.html and this http://forum.coppermine-gallery.net/index.php/topic,77013.0.html I think it works for $theme_ not for $template_.

Anyway I tryed that and it shows code.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #6 on: January 21, 2014, 12:18:09 pm »

PROBLEM SOLVED FOR BREADCUMB:

Code posted by ANDRE here:

http://forum.coppermine-gallery.net/index.php/topic,77013.0.html

function <<<theme_display_breadcrumb>>> (copy it from themes/sample/theme.php if is not in your theme.php)

add before starttable:

Code: [Select]
    global $CPG_PHP_SELF;
    if ($CPG_PHP_SELF == 'displayimage.php') {
        echo '<div class="your_class_here">';
    }


add after endtable:

Code: [Select]
    if ($CPG_PHP_SELF == 'displayimage.php') {
        echo '</div>';
    }

same thing if you want to wrapp the breadcumb only on thumbnails.php or other pages.Replace displayimage.php with thumbnails.php.The categories path is index.php?cat=2 so replace displayimage.php with index.php. etc.

read Reply #9 for breadcumb wrapped in a diffrent div for every page
« Last Edit: January 21, 2014, 12:44:28 pm by allvip »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #7 on: January 21, 2014, 12:23:24 pm »

I wrapped the ul from $template_sys_menu and is showing on all the pages.
This means it works as expected and we now can focus on displaying it just on displayimage.php?

$template_sub_menu has only $template_sub_menu = $template_sys_menu;.A div here breaks the theme.
No need to insert it a second time if $template_sub_menu just a refers to $template_sys_menu.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #8 on: January 21, 2014, 12:24:29 pm »

This means it works as expected and we now can focus on displaying it just on displayimage.php?
No need to insert it a second time if $template_sub_menu just a refers to $template_sys_menu.

OK
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #9 on: January 21, 2014, 12:31:11 pm »

The breadcumb can have many ifs: wrapp it in a div only on displayimage,in another div only on thumbnails.php and in another div only on index.php (for categories index.php?cat=...)

like this:

function <<<theme_display_breadcrumb>>> (copy it from themes/sample/theme.php if is not in your theme.php)

add before starttable:

Code: [Select]
    global $CPG_PHP_SELF;
    if ($CPG_PHP_SELF == 'thumbnails.php') {
        echo '<div class="your_class_for_thumbnails.php_here">';
    }
    global $CPG_PHP_SELF;
    if ($CPG_PHP_SELF == 'displayimage.php') {
        echo '<div class="your_class_for_displayimage.php_here">';
    }
    global $CPG_PHP_SELF;
    if ($CPG_PHP_SELF == 'index.php') {
        echo '<div class="your_class_for_index.php_here">';
    }

add after endtable:

Code: [Select]
    if ($CPG_PHP_SELF == 'thumbnails.php') {
        echo '</div>';
    }
    if ($CPG_PHP_SELF == 'displayimage.php') {
        echo '</div>';
    }
    if ($CPG_PHP_SELF == 'index.php') {
        echo '</div>';
    }
« Last Edit: January 21, 2014, 12:40:08 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #10 on: January 21, 2014, 03:42:39 pm »

I tryed.The functions for main_menu just won't work with if index...and the other functions (display image etc) don't have the menu.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #11 on: January 21, 2014, 04:01:28 pm »

I don't understand why you're testing various functions, I thought it works as expected with $template_sys_menu?

As I don't know your current theme code, here an example for the curve theme. Open theme.php, find
Code: [Select]
$template_sys_menu = <<<EOT
<ul class="dropmenu">
          {BUTTONS}
</ul>
EOT;
and below, add something like
Code: [Select]
if ($CPG_PHP_SELF == 'displayimage.php') {
    $template_sys_menu = '<div class="your_class_for_here">'.$template_sys_menu.'</div>';
}
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Diffrent style only for displayimage.php for main menu and breadcumb
« Reply #12 on: January 21, 2014, 04:12:42 pm »

Thanks.It works.

The condition I added in sys_menu was without $template_sys_menu so I did not worked.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.