How to I get breacrumbs to show the current page, whether it be "home" or if I am viewing a book page so that the breadcrumbs also includes that page.

I.e. I am viewing, "Drupal" in "help" in "stuff" so that it shows home >> stuff >> help >> Drupal instead of home >> stuff >> help ??

I.e. see: http://aucklandanimalaction.org.nz/2/foiegras

Instead of saying:

Home » Issues » Foiegras

it says

Home » Issues

Yours,
Simon

Comments

laura s’s picture

What if you added the title right after the breadcrumb in page.php.tpl? (You would need phpTemplate to do this.) In fact, I'm going to go try it right now as it sounds like it might be a nice feature.

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

laura s’s picture

Find your breadcrumb in page.php.tpl and edit the line to read:

<?php print $breadcrumb ?><?php if ($title != ""): ?>&raquo; <?php print $title ?><?php endif; ?>

You will need to wrap this in a div class or id tag and style the class or id in your style.css file to include display: inline. This will add the current page title to the end of the breadcrumb, without a link, which is the norm I've seen on many sites.

Hope this helps!

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

bobo’s picture

Thanks laura, but I can't find page.php.tpl... I think I'm using xtemplate, not phptemplate.

Yours,
Simon

Steven’s picture

You can try adding the page title tag to that place in the .xtmpl (I think it's {title}) but if you want to do any sort of advanced theming, then XTemplate is not the way. You can only override the basic page elements. With PHPtemplate on the other hand, you can access the full theming abilities of Drupal.

There is a recent thread which compares XTemplate and PHPTemplate.

--
If you have a problem, please search before posting a question.

dordal’s picture

Here is an example of the full code for laura's post above, including adding the display:inline to the definition of .breadcrumb in your style sheet, and the "div class='breadcrumb'" around your $title. Thought it might be helpful for anyone who was just copying code, as I was.

So, in page.php.tpl:

<?php print $breadcrumb ?><?php if ($title != ""): ?><div class="breadcrumb">&raquo; <?php print $title ?></div><?php endif; ?>

and in your style.css:

.breadcrumb {
	display:inline;
	padding-bottom: .5em;
}
j-clark’s picture

That example didn't work for me, playing with the Garland theme.

I got it to do what I wanted by changing the phptemplate_breadcrumb function in template.php as follows:

function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    $title = drupal_get_title();
    if (!empty($title)) {
      $breadcrumb[]=$title;
    }
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}

Just in case anybody else wants to do this.
P.S. I am a complete newbie, so if this is a rubbish method, please tell me.

kost’s picture

Thanks. Nice solution.

Daugilas’s picture

j-clark, great example.
I added some css functionality to it.
So all you need to do:
.

1. Prepare file

In your theme dir you have to have 'template.php' file. If there aren't - create one.
.

2. function

to your 'template.php' add this function:

/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    $title = drupal_get_title();
    if (!empty($title)) {
      $breadcrumb[] = '<div class="breadcrumb-current">'. $title .'</div>';
    }
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}

.

3. Style

To your styles file (commonly 'styles.css') add your style. In my case this (just edit colors, etc.):

#container .breadcrumb .breadcrumb-current {
  display: inline;
  color: #7f7f7f;
}

.

Done

Daugilas’s picture

You can do the same with module called "Menu Breadcrumb" (http://drupal.org/project/menu_breadcrumb).
To have the same result I wrote above: in module's configuration uncheck all options and check only "Append page title to breadcrumb". Of course other options adds more functionality, I didn't need them though.

You'll need just to configure your styles separately.

venkat-rk’s picture

It is considered bad usability practice to point to the current page on the breadcrumbs since you are already there- it is like showing a 'Home' link on the home page of a site.

See the section titled, "Third bug: taxonomy breadcrumbs include the current term" on this page for an explanation:
http://www.greenash.net.au/posts/thoughts/basic_breadcrumbs_and_taxonomy

laura s’s picture

I have seen more standard practice in the direction of showing the actual page as unlinked text. Go through the Yahoo directories, for example, and you will see the current directory listed right there at the end of the breadcrumbs.

I looked at the article you cited. It has some interesting ideas, but I would beg to differ on the issue of breadcrumbs.

Try viewing a node: you will see that the breadcrumb trail includes the parent terms of that page, but that the current page itself is not included. This is how it should be: you don't want the current page at the end of the breadcrumb, because you can determine the current page by looking at the title!

That depends on your site design. If your title is right there, then you're right, perhaps it's not needed. But if your title is far away from the breadcrumbs, it's a different story.

And also, each part of the breadcrumb trail is a link, so if the current page is part of the trail, then every page on your site has a link to itself (very unprofessional).

Ah, but there is no link for the current page -- it's just text.

To me, in the article cited there are assumptions about design and blanket rules that don't always apply. AFAIK, there's no consensus against the current page's being included in breadcrumbs. If there were, you could consider me a rebel for not automatically marching in step. ;)

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

Jaza’s picture

As the author of the cited article, I must agree with you in saying that it's a matter of individual taste whether or not the breadcrumb trail should include the current page. As you can tell by reading my article, I have a very strong personal preference for breadcrumbs that don't include the current page. But I was stating my opinion, not dictating any rules.

There are no doubt some designs where one type of breadcrumbs would look better than in other designs. Just use the style that suits your page layout best - if the title is not displayed prominently on your pages, then maybe it is appropriate to show it in the breadcrumb trail. Also, having the current page breadcrumb not as a link is good - I think this helps.

Jeremy Epstein - GreenAsh

Jeremy Epstein - GreenAsh

brooklynwebguy’s picture

My preference is for just showing everything above the page in the trail. However if the last one representing the active page is not linked but simply text that is formatted in a way that clearly distinguishes it from the other items, I don't think that damages any user expectations and therefore the two approaches can co-exist.

That last active page breadcrumb should never be link, though, because then that really does suggest it represents something other than the page the user is on. And regardless of where your breadcrumb trail is, the page title should be prominent and in one of the zones where the user expects to find it. It is only through a common set of conventions that users make their way around the internet morass. If you flout them, there should be sound functional reasons for doing so.

krikette’s picture

From a usability standpoint, it is NOT more user-friendly to leave the current page off of the breadcrumb. It isn't crippling, and it's not really that big of a deal, but every new user has a certain amount of time they will spend on a site before they wander off. Every split second that they spend confused or lost eventually adds to this time and if enough things make them stop and feel confused, they will leave.

There are instances where it could potentially confuse someone however briefly by not having the current page at the end of the breadcrumb, because most people will be expecting the last item to be the place they are at. When this doesn't match the page title they could be confused. If the last item on the breadcrumb is your page title and it links to itself, it may be confusing also.

Note that I use "confusing" here to mean more of "users may stop to wonder why it was done that way". Most people will not care, however there are some that may wonder about it.

I just wanted to rebuff the article's tone and insistance that it is unprofessional to be redundant in web design.

mikeschinkel’s picture

I have seen more standard practice in the direction of showing the actual page as unlinked text. Go through the Yahoo directories, for example, and you will see the current directory listed right there at the end of the breadcrumbs.

Great comment laura s. I would like to echo my STRONG agreement with you on this.

As for websites that do not show a reference the current page as a non-linked title, I find those sites very unprofessional.

vuxes’s picture

Not showing the current page as an unlinked text is like getting caught with your pants down!

Indeed, there is also the need to link the current "page" if there are more than one pages to your node. Say you click to a product review page, so the breadcrumb is: Home >> Reviews >> Product A. The review has 10 pages. In this case, we do want Product A to be displayed as a link so we can quickly return to the beginning of the review (whether you consider it to be page 1 or intro or title page, whatever) as well as provide the links for the 10 pages at the bottom of each page.

Please do not get caught into the strict definition of stuff, guys. Just get practical. Or, just give people the choice.

Bèr Kessels’s picture

If you use it to point users where they are NOW, then including the current page is a good thing (see it as that "you are here mark" on maps).

But one should carefully consider whether or not to make it a link.

---
Professional | Personal
| Sympal: Development and Hosting

schnizZzla’s picture

"But one should carefully consider whether or not to make it a link."

Why would you not make it a link?

jenlampton’s picture

The link would just take people to the page they are already on. It's self-referential, and even though I think it can be helpful to include the active page in the breadcrumbs, it should not be linked.
Jen

*~ current project: www.customerthink.com ~*

solipsist’s picture

I disagree, anything but showing the current document name is very confusing, for a number of reasons.

--
Jakob Persson
web design and usability consulting
http://www.jakob-persson.com

--
Jakob Persson - blog
Leancept – Digital effect and innovation agency

k9gardner’s picture

Beyond anyone's personal preference for how it ought to be done, or whether it's considered good form to have a self-referential link on a page, I can see no factor more significant than what a search engine needs or wants to see on a site to determine what should be presented. The SEO folks that my company is working with are telling me that breadcrumbs are incredibly important for spidering, and who am I to disagree? I just want to deliver the destination needed so that their targeting will work optimally.

Specifically, according to this way of looking at it, the highest order qualifier should not be "home", but should probably be the domain. And the lowest order should in fact be the page you're on.

I am incredibly new to Drupal, and now apparently I need to install something I don't have, as I have not made myself aware of any plugin modules until the need has arisen. Now that the need has arisen, I'm a little surprised that I have to use taxonomy or install something like phpTemplate in order to create effective breadcrumbs, but so be it. At least – and this is a very very good and big thing – there is a community of developers out there who can and will and have the knowledge to share with others. Thanks everyone.

gregarios’s picture

I guess all those signs, worldwide, that have local map which points out where you are with a "You Are Here" on it are considered bad too? lol

I think looking at the breadcrumbs to see exactly where you are is handy sometimes. :-)

gisle’s picture

The link posted by venkat-rk in the comment “It is considered bad“ is now dead.

One of my students pointed out to me that Jakob Nielsen argues that for reason of consistency, breadcrumbs should always, quote:

“Breadcrumbs are almost always implemented the same way, with a horizontal line that

  • progresses from the highest level to the lowest, one step at a time;
  • starts with the homepage and ends with the current page;
  • has a simple text link for each level (except for the current page [...]); and
  • has a simple, one-character separator between the levels (usually ">").”

Unquote, my italics.

Source: http://www.nngroup.com/articles/breadcrumb-navigation-useful/

- gisle

Downward Spiral’s picture

perhaps my prob is similar to that... my favicon is in the root-directory, but only shown, when bookmarking the homepage... every "?q="-site is bookmarked without the favicon... :(

twohills’s picture

To me it looks counter-intuitive to NOT have the current page in the breadcrumb trail.

the approach of having it there but not an active link makes perfect sense to me and looks the most natural to me.

I'm forever getting momentarily confused by the Drupal breadcrumbs for this reason (I must have a goldfish brain, it gets me over and over)

twohills’s picture

if you don't mind that the breadcrumb for the current page is a clickable link, then it is as simple as commenting out this line in menu.inc in function menu_get_active_breadcrumb()

array_pop($links);

it doesn't work quite right for project_issues but generally it's great

plong0’s picture

Or if you don't want it as a link and wish only to show the title...

leave array_pop($links); uncommented
after it add $links[] = drupal_get_title();

works as a beauty for my needs :D

plong0’s picture

After messing with it I decided I wanted the taxonomy hierarchy to be used for breadcrumbs plus showing the current node page as not a link... it can be done as so...
install and activate the http://drupal.org/project/taxonomy_breadcrumb module
leave checked the "Show current term in breadcrumb trail?" option
she works nicely, but! when you're viewing a page it doesn't show this node in breadcrumbs??
I fixed it in this way...
for your file: modules\taxonomy_breadcrumb\taxonomy_breadcrumb.module
under function of: taxonomy_breadcrumb_generate_breadcrumb($tid, $is_term_page = FALSE)
Locate line: // Do not create links to own self if we are on a taxonomy/term page.
make changes as such:
// Do not create links to own self if we are on a taxonomy/term page.
/** if ($is_term_page && $parent_term->tid == $tid) {
$breadcrumb[] = $parent_term->name;
}
else {*/
//never add own self to the breadcrumb here
if (!($is_term_page && $parent_term->tid == $tid)) {
$breadcrumb[] = l($parent_term->name, $term_path);
}

Locate line: return $breadcrumb;
Before him add:
//add ourself to the breadcrumb here
$breadcrumb[] = drupal_get_title();

now it does my bidding, and can do your's too!!

I am not sure if this is the best solution, but it seems to work as I need. Please let me know if you have a better way?

BassPlaya’s picture

doesn't really work for me with plong0 example:
actually I think I'm doing something wrong but don't know what.. it shows up like this: administer » settings » settings where the first "settings" is not a link but the last one is..

here's my code:

...
    $item = menu_get_item($mid);
    if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) {
      $links[] = menu_item_link($mid);
    }
  }

  // The last item in the trail is the page title; don't display it here.
  array_pop($links); $links[] = drupal_get_title();

  return $links;
}

any solutions?

Authentically,
BassPlaya

tyler-durden’s picture

Or if you don't want it as a link and wish only to show the title...

leave array_pop($links); uncommented
after it add $links[] = drupal_get_title();

works as a beauty for my needs :D

This works for me, but i'd like to know how to use the menu title instead of the page title. Is there a way? Thanks!

Bèr Kessels’s picture

You can override the breadcrumb generation in your theme:

 function mytheme_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    $breadcrumb[] = drupal_get_title();
    return '<div class="breadcrumb">'. implode(' » ', $breadcrumb) .'</div>';
  }
}

.. Is all you need to add to your template.php

This will NOT make the title a lin though. In order to do that, you need to change the line $breadcrumb[] = drupal_get_title(); into $breadcrumb[] = l(drupal_get_title(), $_GET['q']);

---
Professional | Personal
| Sympal: Development and Hosting

twohills’s picture

A nice hook that requires no code changes, thankyou for that.

I've stopped using breadcrumbs for a more fundamental reason. I opened a new thread for it http://drupal.org/node/64348

Zach Harkey’s picture

This is how breadcrumbs should work imho.

What's the best way to get this added to the PHPTemplate Theme Snippets section of the handbook?

-zach
--
harkey design

: z

karldied’s picture

Thanks for the code suggestion, which I put in my template.php, and it works.

I'm with the camp that likes 'home' and the 'current page' in the bread crumb trail, to help site visitors (generally not expert surfers in my case) understand at least one area of the site they may be in.

I'm less sure how to make the current page "gray" using the style sheet while keeping the carrots black (which I like to do to make it even more obvious that it is the 'current page' location).

For some reason, the » (>>) turned into a question mark, so I substituted a single > in the suggested code, and that makes all the separators into single >, which is my preference anyway.

-Karl

karldied’s picture

This code snippet seemed to work when I first installed it, but now gives a double error when trying to log in:

Cannot modify header information - headers already sent ...
session_regenerate_id(): Cannot send session cookie - ...

And error message content of:

session_regenerate_id(): Cannot send session cookie - headers already sent by (output started at /home/karld/lesvoyageurs/html/d/themes/lvtheme/template.php:27) in /home/karld/lesvoyageurs/html/d/modules/user.module on line 943.

Line 27 of template.php is the start of the code <?php

release 4.7.1 (pretty sure...)

Als’s picture

Thanks Bèr, yours is a nice solution.
It is worth adding that to make this snippet work it is necessary to substitute 'mytheme' in the function with the actual theme name. :-)

kimangroo’s picture

Thanks for that. I had to replace ' » ' with ' &raquo; ' to get the proper delimiter thingy.

wflorian’s picture

If there is a "&" in the title of the node, I do get a "&amp;" in the breadcrumb.

I found the following solution here http://drupal.org/node/344449:

- $breadcrumb[] = l(drupal_get_title(), $_GET['q']);
+ $breadcrumb[] = l(drupal_get_title(), $_GET['q'], array('html' => TRUE,));

Unfortunately it doesn't work. I still get a "&amp;" in the breadcrumb. Is it because of I am using D5, and the patch is for D6?

Thanks for your help.

kayfish’s picture

i would actually like to -remove- the HOME link from the breadcrumb. It is very redundant on my site - It's in the primary navigation and the user can also click on my icon. When I'm one level down in my hierarchy, the 'home' link is very distracting.

Does anyone have any suggestions on how I might do this?

THanks!

_craig’s picture

If you want your breadcrumbs to follow your taxonomy structure, check out taxonomy_breadcrumb. After installing, you can go to /admin/settings/taxonomy_breadcrumb to remove (or change) the "Home" breadcrumb.

here’s picture

The following override also works quite simply to remove the first element from the breadcrumb trail. Put the code in your theme's template.php .

function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
      $breadcrumb[] = drupal_get_title();
        array_shift($breadcrumb);
        return '<div class="breadcrumb">'. implode(' &#187; ', $breadcrumb) .'</div>';
  }
}

don't forget to expand the '»' back out to '& #187;' (no space) in the code.

ludoal’s picture

Thanks for your snippet.
I added array_pop($breadcrumb); just after the array_shift function to get rid of the current node title in the breadcrumb.

fseraphine’s picture

The easiest way to remove the breadcrumb is to change the drupal.css.

In drupal\misc edit drupal.css and change

.breadcrumb {
  padding-bottom: .5em;
}

to

.breadcrumb {
  padding-bottom: .5em;
  display: none;
}

Et voilà, the breadcrumb doesn't appear anymore if the theme doesn't override the basic CSS with "display: something ! important;".

Als’s picture

---> This comment was put in the wrong position and has been moved by author <--

intfocus’s picture

I found another alternative to the current responses listed:

Open /includes/menu.inc and scroll down to line 547 which should read:

// The last item in the trail is the page title; don't display it here.
array_pop($links);

Comment out array_pop($links); to allow you to backtrack in case you want to revert your changes.

Code Source:
- http://api.drupal.org/api/function/menu_get_active_breadcrumb/6 (Drupal Function)
- http://www.php.net/array_pop (in case you want to know what it does)

Note:
- Using this example will NOT remove the current page link. But it's easier than recoding your template.php file.

- This method returns the Menu Link Title NOT the Page Title (I prefer this - since it allows me to use keywords in my titles). If you want your Page Title to appear, use Bèr Kessels' method.

Enjoy!

PinkChocobo’s picture

Hi there,
I'm having a similar problem, but I'm having issues trying to fix this with little php experience. The breadcrumbs work for the administer pages, but on all other page it simply says "home" and does not add breadcrumbs when I get further into the site. I've seen other posts with this complaint, and after trying the fixes I still can't get it to work.

template.php:

function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return '<div class="breadcrumb">'. implode(' &raquo; ', $breadcrumb) .'</div>';
  }
}

page.tpl.php:

<div id="main">
        <?php if ($title != ""): ?>
          <?php print $breadcrumb ?>
          <h1 class="title"><?php print $title ?></h1>
PinkChocobo’s picture

the taxonomy breadcrumbs took care of this issue

PinkChocobo’s picture

Menu trees prove to work different in the framework depending on how you use it. If you use the default Drupal menuing system (like the navigation), breadcrumbs automatically work. Otherwise, custom breadcrumbs http://drupalmodules.com/module/custom-breadcrumbs module or menu trails (really awesome module) http://drupalmodules.com/module/menu-trails works to correct this

tobiassjosten’s picture

My suggestion is to use the contributed module Custom Breadcrumbs to solve this, with the setup I explain in another thread.

gownikarunakar’s picture

Hi,

I have tried using phptemplate_breadcrumb() function to manipulate the breadcrumb but there is no change in the pages.

Can anyone help on how to change the breadcrumbs on the pages?

I have only added the above function in the template.php file.

Thanks in Advance
Karunakar

panos’s picture

According to my opinion, the most important issue when talking about breadcrumbs in Drupal is that the CMS doesn't put any restrictions on the hierarchy when you create content.

On one hand you have Joomla, where you "have to" select section and category before creating any content. On the other hand you have Drupal where you just create content.

One Joomla example that I have is Sailing Channel where creating meaningful breadcrumbs was a piece of cake. On the other hand I have a hugely successful website based on Drupal 5, Bank Expert with loads of content and the only meaningful hierarchy is at the menu. The menu hierarchy can't be transferred to the breadcrumbs easily, unless I do a lot of research and probably change a lot in the way that I'm running this already 2 years old website. And that IMHO should be addressed by the community somehow (at least better instructions on how to create and organize content).

chadhester’s picture

Thanks for the module posts... Menu Breadcrumb worked like a charm for me. I agree that many sites shouldn't post the current page's link in the breadcrumb, but I do like providing more access wherever possible (when not obstructive or busy).

__________
Regards,
Chad Hester

jalake’s picture

Since I located this page looking for the answer to the same question, here is something for Drupal 6 users (and probably 7)

Visit Admin -> Themes -> Configure -> Your Theme (/admin/build/themes/settings/) and edit the Breadcrumb settings to show/hide the current page.

Granted I'm using a Zen sub-theme, so your mileage may vary.

code-brighton’s picture

Put the following in your themes (or my Omega sub-theme in my case) template.php

function yourthemename_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];
  // Determine if we are to display the breadcrumb.
  $show_breadcrumb = theme_get_setting('yourthemename_breadcrumb');
  if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {

    // Optionally get rid of the homepage link.
    $show_breadcrumb_home = theme_get_setting('yourthemename_breadcrumb_home');
    if (!$show_breadcrumb_home) {
      array_shift($breadcrumb);
    }

    // Return the breadcrumb with separators.
    if (!empty($breadcrumb)) {
      $breadcrumb_separator = theme_get_setting('yourthemename_breadcrumb_separator');
      $trailing_separator = $title = '';
      if (theme_get_setting('yourthemename_breadcrumb_title')) {
        $item = menu_get_item();
        if (!empty($item['tab_parent'])) {
          // If we are on a non-default tab, use the tab's title.
          $title = check_plain($item['title']);
        }
        else {
          $title = drupal_get_title();
        }
        if ($title) {
          $trailing_separator = $breadcrumb_separator;
        }
      }
      elseif (theme_get_setting('yourthemename_breadcrumb_trailing')) {
        $trailing_separator = $breadcrumb_separator;
      }

      // Provide a navigational heading to give context for breadcrumb links to
      // screen-reader users.
      if (empty($variables['title'])) {
        $variables['title'] = t('You are here');
      }
      // Unless overridden by a preprocess function, make the heading invisible.
      if (!isset($variables['title_attributes_array']['class'])) {
        $variables['title_attributes_array']['class'][] = 'element-invisible';
      }
      $heading = '<h2' . drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . '</h2>';

      return '<div class="breadcrumb">' . $heading . implode($breadcrumb_separator, $breadcrumb) . $trailing_separator . $title . '</div>';
    }
  }
  // Otherwise, return an empty string.
  return '';
}

Put the following in your themes theme.settings.php

function yourthemename_form_system_theme_settings_alter(&$form, $form_state) {
  /*
   * Create the form using Forms API
   */
  $form['breadcrumb'] = array(
    '#type'          => 'fieldset',
    '#title'         => t('Breadcrumb settings'),
  );
  $form['breadcrumb']['yourthemename_breadcrumb'] = array(
    '#type'          => 'select',
    '#title'         => t('Display breadcrumb'),
    '#default_value' => theme_get_setting('yourthemename_breadcrumb'),
    '#options'       => array(
                          'yes'   => t('Yes'),
                          'admin' => t('Only in admin section'),
                          'no'    => t('No'),
                        ),
  );
  $form['breadcrumb']['breadcrumb_options'] = array(
    '#type' => 'container',
    '#states' => array(
      'invisible' => array(
        ':input[name="yourthemename_breadcrumb"]' => array('value' => 'no'),
      ),
    ),
  );
  $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_separator'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Breadcrumb separator'),
    '#description'   => t('Text only. Don’t forget to include spaces.'),
    '#default_value' => theme_get_setting('yourthemename_breadcrumb_separator'),
    '#size'          => 5,
    '#maxlength'     => 10,
  );
  $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_home'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Show home page link in breadcrumb'),
    '#default_value' => theme_get_setting('yourthemename_breadcrumb_home'),
  );
  $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_trailing'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Append a separator to the end of the breadcrumb'),
    '#default_value' => theme_get_setting('yourthemename_breadcrumb_trailing'),
    '#description'   => t('Useful when the breadcrumb is placed just before the title.'),
    '#states' => array(
      'disabled' => array(
        ':input[name="yourthemename_breadcrumb_title"]' => array('checked' => TRUE),
      ),
      'unchecked' => array(
        ':input[name="yourthemename_breadcrumb_title"]' => array('checked' => TRUE),
      ),
    ),
  );
  $form['breadcrumb']['breadcrumb_options']['yourthemename_breadcrumb_title'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Append the content title to the end of the breadcrumb'),
    '#default_value' => theme_get_setting('yourthemename_breadcrumb_title'),
    '#description'   => t('Useful when the breadcrumb is not placed just before the title.'),
  );

}

put the following in your theme.info file

settings[yourthemename_breadcrumb]           = yes
settings[yourthemename_breadcrumb_separator] = ' › '
settings[yourthemename_breadcrumb_home]      = 1
settings[yourthemename_breadcrumb_trailing]  = 1
settings[yourthemename_breadcrumb_title]     = 0

replace all instances of yourthemename_ (with your actual theme name!)

then goto Configuration -> Performance and flush cache
then goto Appearance -> settings (for your theme) - you should see new options for editing breadcrumbs

tajinder.minhas’s picture

I have seen this functionality in most of the website, but drupal core breadcrumb functionality doesnt allow it. So i have wrote this code to have breadcrumb exact replica of url, and the last item of breadcrumb will not have any link and is the title of url. It can be done through module as well and with drupal_set_breadcrumb we can show the requisite breadcrumb. Check it and reply if you find the code in following url helpful.

http://drupal.org/node/1616020

Regards
Tajinder Singh Minhas
Software Engineer
(SDG SIPL)

Greg Boggs’s picture

If you're trying to dot his for Drupal 8, this post will give you everything you need to know: http://www.gregboggs.com/drupal8-breadcrumbs/