A snag with the breadcrumb trail A snag with the breadcrumb trail
 

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]

Main Menu

A snag with the breadcrumb trail

Started by uk_martin, December 28, 2010, 03:32:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

uk_martin

I refer to the breadcrumb trail customisation dealt with here - http://forum.coppermine-gallery.net/index.php/topic,68715.0.html

I've just noticed a problem with it. The "{HEADER_BREADCRUMB}" appears now on pages that may not be designed to have a breadcrumb trail, e.g. http://brummiesfans.com/coppermine/albmgr.php?cat=0

Is there a way to restrict the breadcrumb trail, in the postition where it is, to only display either completely, or not at all? In other words, if there is no Home>Gallery>Album etc then it does not display {HEADER_BREADCRUMB} which it does at the moment.

Or maybe if there is a "proper" breadcrumb trail, it uses the CSS class="breadcrumb" or if not, then the colour could be set to the background colour to at least make it appear as if it isn't there?

Thanks in advance.

Maritn

ΑndrĂ©

Open your theme.php file, find
    // Breadcrumb hack - START
    $CONFIG['main_page_layout'] = str_replace(array('/breadcrumb', 'breadcrumb/', 'breadcrumb'), '', $CONFIG['main_page_layout']);
    global $breadcrumb;
    if ($breadcrumb) {
        ob_start();
        theme_display_breadcrumb($breadcrumb);
        $template_vars['{HEADER_BREADCRUMB}'] = ob_get_clean();
    }
    // Breadcrumb hack - END

and replace with
    // Breadcrumb hack - START
    $CONFIG['main_page_layout'] = str_replace(array('/breadcrumb', 'breadcrumb/', 'breadcrumb'), '', $CONFIG['main_page_layout']);
    global $breadcrumb;
    ob_start();
    theme_display_breadcrumb($breadcrumb);
    $template_vars['{HEADER_BREADCRUMB}'] = ob_get_clean();
    // Breadcrumb hack - END

(not thoroughly tested). Please report if it works as expected in your whole gallery, so I can update the code in the other thread.

uk_martin

Thanks Andre, that works perfectly now!
:)