Maybe I'm overlooking it, but is there any way to get the page's active menu trail in the breadcrumb?

Comments

rboedeker’s picture

I could not find it either and managed the requirement with a panels (ctools) context plugin. It simply loads the menu active trail into the ctools context.

mexthecat’s picture

Maybe this helps

  • IreneV committed 44c83e3 on 7.x-2.x
    Issue #2000432 by mexthecat: Menu Trail in breadcrumb' --author="git...
IreneV’s picture

Will be added to new release

IreneV’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dsnopek’s picture

It looks like this was actually merged on this commit:

https://git.drupalcode.org/project/panels_breadcrumbs/-/commit/e64800d81...

The commit message got swapped with #2584099: Panelizer breadcrumb defaults not used

Recording here in case there's any confusion in the future!

dsnopek’s picture

Status: Closed (fixed) » Needs work

There's a couple problems with this change, so I've reverted it.

  1. +++ b/panels_breadcrumbs.module
    @@ -113,6 +114,12 @@ function panels_breadcrumbs_partial_configuration_form($conf, $contexts) {
    +    '#default_value' => isset($conf['panels_breadcrumbs_menu_active_trail']) ? $conf['panels_breadcrumbs_menu_active_trail'] : FALSE,
    

    This works, but would be clearer as:

    '#default_value' => !empty($conf['panels_breadcrumbs_menu_active_trail']))
    
  2. +++ b/panels_breadcrumbs.module
    @@ -217,6 +226,10 @@ function panels_breadcrumbs_build_breadcrumb($conf, $contexts, $override = FALSE
    +    if (!isset($conf['panels_breadcrumbs_menu_active_trail']) || $conf['panels_breadcrumbs_menu_active_trail'] == TRUE) {
    

    The boolean logic here means this will be enabled by default. Looking at the rest of the patch, it appears the intention is for this to be disabled by default. And, by enabling it by default, the breadcrumbs on existing sites that update to the latest version will have their breadcrumbs change immediately, so we probably do want it disabled by default.

    This could be re-written as:

    if (!empty($conf['panels_breadcrumbs_menu_active_trail'])) {
    

The current patch will also need to be re-rolled for other changes to the repo in the meantime.

  • dsnopek committed 6bdb0ff on 7.x-2.x
    Bit of code from Issue #2000432 that missed in the revert
    
astonvictor’s picture

Status: Needs work » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks