Hello Breadcrumb experts!

I am wondering why the breadcrumb looks like this:

Home » Administration » Store » Configuration

When the URL looks like this:

/admin/store/settings/cart

Putting aside semantic niggles like the two paths are not "mirrored"

Configuration != settings 

And the fact that the main-level hook_menu title is misleading:

Store != Ubercart

I am wondering why the breadcrumb stops one level earlier than the URL?

Why couldn't it be:

Home » Administration » Store » Configuration » Cart

Regardless of whether or not the page $title is set to "Cart"?

Perhaps this has been covered somewhere before?  

Would this be a "breaking change"?

Can someone deeper with the lore point the way?

Thanks.

g.

----

Accepted answer

Comments

Try the Breadcrumb block settings option «Display the current page title as the last breadcrumb».

Hello @Enthusiast!

Where might I find that setting please?

I looked around "some" but could not find what you describe...

Thanks,

g.

----

/admin/structure/layouts

Click "Manage blocks" in your Layout, configure "Breadcrumb" block.

Or use Contextual Link:


 

Hello @Enthusiast!

 I do not have this path.  I am using D7.

 My path is /admin/structure/block

 I do not have the setting you describe.

 Thanks anyways,

 g.

 ----

We are on the Backdrop CMS forum, naturally we are answering about Backdrop CMS, and not about Drupal. These two systems are slightly different, so you may not get the answer you need, mislead visitors to this forum and waste other people's time.

If I'm not mistaken, Drupal 7 does not have a block of breadcrumbs and the option that I wrote about.

Correction:

I found out today I am actually using the Seven theme as my Administrative theme.

In:

/site/themes/seven/template.php

As:

/**
* Override of theme_breadcrumb().
*/
function seven_breadcrumb($variables) {
 $breadcrumb = $variables['breadcrumb'];

 if (!empty($breadcrumb)) {

   $breadcrumb[] = drupal_get_title();

   // Provide a navigational heading to give context for breadcrumb links to
   // screen-reader users. Make the heading invisible with .element-invisible.
   $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

   $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
   return $output;
 }
}

 

Errata of correction.

I just discovered that just getting the page title results in an unclickable breadcrumb element (i.e. plain text).  So, here's the correct code, which results in a clickable last breadcrumb element for the seven theme.

/**
* Override of theme_breadcrumb().
*/
function seven_breadcrumb($variables) {
 $breadcrumb = $variables['breadcrumb'];

 # 2024-10-16-GL  Get the current page title into local variable
 $local_page_title = drupal_get_title();

 # 2024-10-16-GL  Get the current page path into local variable
 $local_page_path = drupal_get_path_alias();

 # 2024-10-16-GL  Construct current page link
 $local_page_link = l($local_page_title, $local_page_path);

 # 2024-10-16-GL  Add current page link to breadcrumb
 $breadcrumb[] = $local_page_link;

 if (!empty($breadcrumb)) {

   // Provide a navigational heading to give context for breadcrumb links to
   // screen-reader users. Make the heading invisible with .element-invisible.
   $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

   $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
   return $output;
 }
}

Here's the relevant www.drupal.org discussion, including the above code:

https://www.drupal.org/comment/reply/743366

g.
----