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
-
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.
-
What exactly is "the menu"? Coppermine has different menus.
-
I already said in the title,the main menu:Home Register Log in Album List
-
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
-
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.
-
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.
-
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:
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
-
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.
-
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
-
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>';
}
-
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.
-
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>';
}
-
Thanks.It works.
The condition I added in sys_menu was without $template_sys_menu so I did not worked.