forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on January 21, 2014, 12:17:42 am

Title: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip on January 21, 2014, 12:17:42 am
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.
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: Αndré on January 21, 2014, 10:06:41 am
What exactly is "the menu"? Coppermine has different menus.
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip on January 21, 2014, 10:14:49 am
I already said in the title,the main menu:Home Register Log in Album List
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: Αndré 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.
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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 (http://forum.coppermine-gallery.net/index.php/topic,77014.0.html) and this http://forum.coppermine-gallery.net/index.php/topic,77013.0.html (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.
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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 (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
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: Αndré 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.
Title: Re: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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>';
    }
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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.
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: Αndré 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>';
}
Title: Re: Diffrent style only for displayimage.php for main menu and breadcumb
Post by: allvip 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.