Advanced search  

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]

Pages: [1]   Go Down

Author Topic: A snag with the breadcrumb trail  (Read 5096 times)

0 Members and 1 Guest are viewing this topic.

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
A snag with the breadcrumb trail
« on: December 28, 2010, 03:32:59 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: A snag with the breadcrumb trail
« Reply #1 on: December 30, 2010, 10:33:52 am »

Open your theme.php file, find
Code: [Select]
    // 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
Code: [Select]
    // 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.
Logged

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: A snag with the breadcrumb trail
« Reply #2 on: December 30, 2010, 03:26:15 pm »

Thanks Andre, that works perfectly now!
 :)
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.