Diffrent style only for displayimage.php for main menu and breadcumb Diffrent style only for displayimage.php for main menu and breadcumb
 

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

Diffrent style only for displayimage.php for main menu and breadcumb

Started by allvip, January 21, 2014, 12:17:42 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

allvip

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.

Αndré


allvip

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

allvip

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

Αndré

Quote from: allvip on January 21, 2014, 10:14:49 AM
Home Register Log in
= sys_menu

Quote from: allvip on January 21, 2014, 10:14:49 AM
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.

allvip

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.

allvip

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:


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



add after endtable:


    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

Αndré

Quote from: allvip on January 21, 2014, 11:27:26 AM
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?

Quote from: allvip on January 21, 2014, 11:27:26 AM
$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.

allvip

Quote from: Αndré on January 21, 2014, 12:23:24 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

allvip

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:


    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:


    if ($CPG_PHP_SELF == 'thumbnails.php') {
        echo '</div>';
    }
    if ($CPG_PHP_SELF == 'displayimage.php') {
        echo '</div>';
    }
    if ($CPG_PHP_SELF == 'index.php') {
        echo '</div>';
    }

allvip

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.

Αndré

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
$template_sys_menu = <<<EOT
<ul class="dropmenu">
          {BUTTONS}
</ul>
EOT;

and below, add something like
if ($CPG_PHP_SELF == 'displayimage.php') {
    $template_sys_menu = '<div class="your_class_for_here">'.$template_sys_menu.'</div>';
}

allvip

Thanks.It works.

The condition I added in sys_menu was without $template_sys_menu so I did not worked.