Advanced search  

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

Pages: [1]   Go Down

Author Topic: A snag with the breadcrumb trail  (Read 5040 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.