As the name suggests, Custom Breadcrumbs allows you to create and modify your own breadcrumbs based on node type. After enabling the module, go to Administer > User management > Access control. Grant the "administer custom breadcrumbs" permission to the appropriate roles. Then go to Administer > Site building > Custom breadcrumbs. On this page you'll see the option to add a new custom breadcrumb.

Clicking on that link, you have the option to select the node type the breadcrumb will apply to.

Below that, there are two text fields: "Titles" and "Paths." When creating a breadcrumb, you're simply creating a link. In the custom breadcrumbs interface "Titles" describes the text of the breadcrumb while "Paths" describes the Drupal path the breadcrumb links to. So each line of the title field corresponds to the equivalent line of the paths field. Thus, you must have the same number of titles and paths.

To give a very simple example of how to use this module, let's say I have a blog on my web site called "Deep Thoughts." To create this, I use the Views module to create a page at /blog that displays all the node types "blog post." Whenever a user views a blog post I want the breadcrumb to show Home > Deep Thoughts instead of simply Home. To do this I would simply type "Deep Thoughts" in the titles field and "blog" in the paths field and save my breadcrumb. Then, the first item in the breadcrumb would say "Deep Thoughts" and link to the path "blog" (the location of views page that lists blog posts).

Working with Tokens

Using the Token module, the Custom Breadcrumbs module becomes much more flexible: breadcrumbs can be dynamic. So I could create a breadcrumb like Home > Deep Thoughts > [Month of Blog Post] [Year of Blog Post] Where "Deep Thoughts" links to my main blog page and "[Month of Blog Post] [Year of Blog Post]" links to a view that shows only blog posts from the month and year the blog post was created (e.g. June 2007). To do this, create a custom breadcrumb for the node type "blog":

Titles:
Deep Thoughts
[month] [yyyy]

Paths:
blog
blog/[mm]_[yyyy]

(where of course, blog/[mm]_[yyyy] is the path to the view of blog posts from that month and year).
So if I created a blog post today (June 13, 2007) my breadcrumb would show Home > Deep Thoughts > June 2007 and "June 2007" links to "blog/06_2007" which is a view of all blog posts from June 2007.

Note:

  • that Custom Breadcrumbs doesn't actually check to be sure that a particular path exists, so you'll have to check yourself to avoid 404 errors.
  • blank lines in path and title lists are not stripped, and so can mess up the configuration.

Breadcrumb Visibility

Users given 'use php in custom breadcrumbs' permission can include php code snippet that returns TRUE or FALSE to control whether or not the breadcrumb is displayed. Note that this code has access to the $node variable, and can check its type or any other property.

Other reasons that the breadcrumb might not display, or that a breadcrumb trail other than expected displays, is that modules can override the breadcrumb trail. The module that has the highest priority gets to set the trail. There is no UI for setting module priority - you have to manually edit the weight field in the system table. Find the custom_breadcrumb's existing weight and change it to something higher than the competing module. One module that can compete in this way is the Image module.

Be sure to check your configuration settings in admin/config/user-interface/custom-breadcrumbs. If you attempt to use a wildcard '*' in your path but do not enable that checkbox under Advanced Settings on this page, your breadcrumbs will not display.

Special Identifiers

Special identifiers are provided to achieve a special behavior:

The following identifiers can be used to achieve a special behavior. Identifiers should be added to the paths area in the following format: identifier|path.
For example: <pathauto>|[ogname-raw]

Identifier: <none> Behaviour: This will result in a plain text crumb. This identifier should not be used with the pipe (|) symbol.

Identifier: <pathauto> Behaviour: Cleans the given path using your pathauto replacement rules.

Unlinked Node titles

For anyone wondering how to add the current node's title to the end of the breadcrumb, without an ugly theme hack, I would like to chip in with my suggestion. By using this module, you can for example set the custom breadcrumbs like this.

Titles:
Deep Thoughts
[month] [yyyy]
[title]

Paths:
blog
blog/[mm]_[yyyy]
<none>

The <none> token isn't listed but it works just as well, making the breadcrumb item a plain text string.

It is suggested you apply proper CSS to differentiate the plain text from the links, so not to confuse the users and to make it more obvious that this list of links (breadcrumb) is a site map of sorts.

Comments

SpriteGF’s picture

There's now a field titled "Breadcrumb visibility" that allows you to customize where your breadcrumbs are applied. In most cases, you can just insert "return TRUE;" in that field (without the <php> tags).

capellic’s picture

I setup a content type for pages in each one of the sections on my website. I don't want the section's landing page to have itself listed in the breadcrumbs, so I add this bit of code where the nid is the landing page:

if ($node->nid != 43) return TRUE;
SpriteGF’s picture

Your breadcrumbs might not appear at all because another module (e.g. Image module) may be prioritizing its own breadcrumb trail over your custom breadcrumb trail. If you find this is the case, you can give priority to the Custom Breadcrumbs module by increasing the "module weight". To do this, go to your MySQL database's system table, find the custom breadcrumbs module's entry, then change the weight of that module to something higher than the image module's weight, like 10.

(similar problem: http://drupal.org/node/278306 )

mysmp.com’s picture

Hi, Thanks for the module. I have installed it and modified the database to increase the weight to 10 then 11 then 89 and still no luck. Can you provide me with any suggestions? Thanks

DisgustedWithThis’s picture

Yeah.
Write your app in something other than Drupal.

Welcome to Open Source Daycare - where it won't work, and nobody will tell you why, because documentation is for squares, making something comprehensible is alien to the people who wrote the module, etc.

You won't get an answer here. All you will get is you and many other people frustrated, wasting HOURS, practically BEGGING for someone, somewhere to take FIVE MINUTES to write down more than just "release notes"

e.g.

The term ID is now php enabled with the taxonomy of the vocabulary - RJD

and write something MEANINGFUL, EXPRESSIVE, etc.

NancyDru’s picture

The best place to ask for help is in the module's issue queue.

rogman_lebnh’s picture

Hi there,

I find this stuff easier to manage by using the current theme settings and by using the theme's template.php file. That's just my experience. Zen has some pretty good examples in its template.php file.

Speaking of the template.php file, the php function "print_r($whatever_var)" is your best friend (when surrounded by <pre> tags)! That shows you how Drupal data-structures that live inside php variables are constructed.

That's just my two cents. Good luck.

-Roger

tobiassjosten’s picture

For anyone wondering how to add the current node's title to the end of the breadcrumb, without an ugly theme hack, I would like to chip in with my suggestion. By using this module, you can for example set the custom breadcrumbs like this.

Titles:
Deep Thoughts
[month] [yyyy]
[title]

Paths:
blog
blog/[mm]_[yyyy]
<none>

The <none> token isn't listed but it works just as well, making the breadcrumb item a plain text string.

I would personally also apply proper CSS to differentiate the plain text from the links, so not to confuse the users and to make it more obvious that this list of links (breadcrumb) is a site map of sorts.

nally’s picture

When I do this, with 2.x, I'm left with the separator character at the end of the title, which seems wrong to me. Is there a different way to achieve this?

Christian Nally - B.C., Canada - http://sticksallison.com

jaiprakash.pathak’s picture

hey,
i want the title as link... instead of .
pls help me with this.

Yura Filimonov’s picture

Actually, if you don't link the node title to the URL, you need to have one path *less*, than the amount of names.

For example, I have:

Names:
Blog
[title]

Paths:
blog (blog URL)

It is shown as:
Home -> Blog (linked) -> Page title (no link)

I tried having the same amount of names and paths and it didn't work. I suspect this is the main reason many people say the module doesn't work. Implementing good instructions into the module and maybe even a helpful error message would help a lot.

mry4n’s picture

As this post illustrates, some code is missing that will throw an error message if you do not have the same number of titles as paths. Instead you just keep sitting at the edit screen wondering what happened. In my case, I thought I had the same number of titles as paths. I did not realize that the module counts your blank lines. Make sure you delete any blank lines after your lists of titles and paths.

exodiac’s picture

Hello, im trying to print my breadcrumbs like this
print $breadcrumb;
whitin my contemplate in a special position of my content, but the breadcrumbs doesn´t show up, i followed the instruccions in the readme file, but no solution...

Do you have any idea what i´m doing wrong?

Thanks in advance

panos’s picture

I strongly believe that the most important issue is streamlining hierarchy in the content creation work-flow. That would create paths in Drupal's breadcrumbs that actually make sense for visitors.

webtiq’s picture

Hi everybody,
I am using the current dev version on a D6 site already in production and it works so well.
Drupal content navigation was really painful until I discover this module.

Thanks a lot to those who develop and maintain this module. It needs some effort for understanding compared to the most other modules that I use.

But I would definitely recommend you to carefully read this page: http://drupalcode.org/viewvc/drupal/contributions/modules/custom_breadcr...

before you start using this module.
Don't use any other module for breadcrumb matters before you test this one. I think it should really be integrated to Drupal 7

londondave’s picture

I am stuck with how to show a views breadcrumb and then the breadcrumb for a node on a views page?

I need views to work like:

home >> cars >> nid-title_of_node

'cars' path could be 'views/view_cars' and the path of a link in the view table might be 'cars/petrol/188-fast-car-for-you'

'cars' is a view that produces a table of nodes of the category (or taxonomy) 'car', each row of the table is a link to the node content (the link is the title of the node).

I can setup up the view breadcrumb in 'custom breadcrumbs 2 admin page' ok, but when I try to get a breadcrumb for a link (to a node) on the view page, as soon as a link is clicked the breadcrumbs are rewritten and the view breadcrumb is lost.

Any ideas how I can do this?

harriska2’s picture

Yep, trying to figure out the same thing right now... seems like it should be easy but I'm not finding any examples.

hikarimay10’s picture

Thanks for your help but I have a node that is from the Primary Links but the breadcrumb shows 'Home » Details' but I want the menu title to be shown too such as 'Home » Primary Links >> Details'. I want this feature because I added other menus so I want the users to know which menu the node belongs to. What should I do?

I also have a view to display all Bookmarks and in the Page settings for the view I added the path and menu. In custom breadcrumbs I added the title and path but when I click the menu link the breadcrumb just shows 'Home' instead of 'Home >> Bookmarks'.
Title:
Bookmarks
Path:
corporate/bookmark
What am I doing wrong?

Thanks for your help.

NancyDru’s picture

This kind of post should be a support request in the module's issue queue.

smilysarat’s picture

I used Node Bread crumb module for the version 6. It works well as i desired but when i worked with drupal 7 version its not fair.. so i am trying to use custom bread crumble

I want to see my breadcrumbs like this
Home>>Primary Menu >> Inner page
Ex:
Home >> About Us >> Company Profile
Titles*:
[node:type]
[node:title]

Path*:
[node:type]
[node:type]/[node:title]

im writing like this,its not working as i desired please........ help me where im doing wrong..
Its very urgent for me please help...

Thank u soo...... much in advance

pik’s picture

I use burnt rubber theme. It is overriding custom breadcrumbs. No custom breadcrumb shows. Anyone knows how to fix it? Thanks.

smilysarat’s picture

if u use version 6 then try node Bread crumb module.... For version 7 use Menu Breadcrumb it works very well for bread crumbs

beczesz’s picture

Since I couldn't see too much thanks giving for the developers: Thank you guys and girls :)

Ujin’s picture

I am using, Drupal 7.24 with custom breadcrumbs module, it didn't work for nodes at all, but when I put weight of module in database to 100 it is working fine now. I saw this suggestion in previous posts, so Thanks guys!

laura lou’s picture

I have some basic pages that have a URL alias set where it contains a relative path (ie., facstaff/my_page). So the url is rewritten as http://webroot/facstaff/my_page. The breadcrumbs to "My Page" says, Home > Facstaff > My Page

How do I make every breadcrumb reference from "Facstaff" to "Faculty and Staff"?

I tried using "Faculty and Staff" as the Title and then entered "facstaff" as the Path, but nothing happens. Am I using this correctly? I'd like to rewrite this breadcrumb globally across all pages that contain "facstaff" in their url.

Thanks