Crumbs can be used to create taxonomy-based breadcrumbs.
The plugins for that are already built-in.
You can enable them on Admin > Structure > Crumbs (admin/structure/crumbs
).
Prerequisites:
- Taxonomy module enabled on your site.
- Some vocabularies existing on your site.
For the examples below, we assume having a vocabulary named "animal_categories" and another vocabulary named "tags". - Some node types with "term reference" fields.
For the examples below, we assume having a field named "field_animal_category" (on "animal" node type), and another field named "field_tags" (on "article" node type). - We assume we have a views page at "animals" which gives an overview of the available animal categories.
Desired breadcrumb:
Home » Animals » Mammals » Whales & Dolphins » Flipper
Quick summary
(crumbs-7.x-2.x only)
Visit Admin > Structure > Crumbs > Entity parent > Taxonomy
Specify "animals" as the parent path pattern for "Animal category" taxonomy terms.
Visit Admin > Structure > Crumbs
Make sure the following plugin keys are enabled:
taxonomy.termReference.field_animal_category.node.*
(medium priority)
taxonomy.termParent.categories
(medium priority) (*)
crumbs.entityParent.taxonomy_term.categories
(low priority) (**)
(*) probably already implicitly enabled via *
wildcard, so you don't really need to take action.
(**) probably already implicitly enabled via *
wildcard, but you need to adjust the priority.
More detailed explanations for each step:
On node pages (node/%)
We want that nodes which have a category set in "field_animal_category" use the category as the breadcrumb parent.
On the other hand, we don't want that field_tags plays any role in the breadcrumbs.
Long story short (spoiler):
Enable the plugin key taxonomy.termReference.field_animal_category.node.*
, by moving it into the "enabled" section (set the priority as you see fit).
Longer explanation:
Watch out for plugin keys that begin with taxonomy.termReference.
. E.g.:
taxonomy.termReference.* (disabled by default)
taxonomy.termReference.field_tags.*
taxonomy.termReference.field_tags.node.*
taxonomy.termReference.field_tags.node.article
taxonomy.termReference.field_animal_category.*
taxonomy.termReference.field_animal_category.node.*
taxonomy.termReference.field_animal_category.node.animal
The taxonomy.termReference.* is "disabled by default", which causes all the child plugin keys to be disabled as well.
This is necessary because usually only some term reference fields are supposed to have a meaning in the breadcrumb.
We now move the taxonomy.termReference.field_animal_category.node.*
into the "enabled" section.
This way, all nodes that have the field_animal_category set will use that for the breadcrumb parent, no matter which node type.
Still doesn't work?
Look in Admin > Structure > Crumbs > Debug, type a node url, and see the different parent-finding plugins in action.
Maybe you need to readjust the priorities.
On taxonomy term pages (taxonomy/term/%, termParent)
You want that taxonomy term pages use the parent term as the breadcrumb parent.
Solution:
It probably already works out of the box!
The plugin key to enable would be either taxonomy.termParent.*
or taxonomy.termParent.animal_categories
.
However, since none of these is "disabled by default", they are probably already doing their job just fine.
Still doesn't work?
Look in Admin > Structure > Crumbs > Debug, type a node url, and see the different parent-finding plugins in action.
Maybe you need to readjust the priorities.
Top-level taxonomy term listing
We create a views page on path "animals" and want to use that as the breadcrumb parent of top-level animal categories (those that don't have another category as a parent).
crumbs-7.x-2.x branch:
Go to Admin > Structure > Crumbs > Entity parent > Taxonomy
On "Animal categories" vocabulary, type "animals" as the parent path pattern.
Then go to Admin > Structure > Crumbs to readjust the weights.
Make sure that crumbs.entityParent.taxonomy_term.animal_categories
has a lower priority than taxonomy.termParent.animal_categories
.
crumbs-7.x-1.x branch:
Create a custom module with a Crumbs plugin, that sets "animals" as the parent path for animal categories. Good luck with that :)
See http://drupal.org/node/1004398
You then visit Admin > Structure > Crumbs and make sure the custom plugin is enabled.
Comments
@ Top-level taxonomy term listing
For this to work (i.e. "Animals" actually getting displayed in the crumbs path), you need to make sure that the overview page has a title set that Crumbs can recognize, and this may not be the case if your overview page isn't being linked from any menus.
A way to achieve this nonetheless is by adding a title via "Menu" in the page settings of the view. This will also add it as a menu entry, but it can be added to one that is not in use (I have actually created a specific menu of overview pages for this purpose, as I have a few scenarios of this kind on a site).
See also this Crumbs support request issue.
Reference for taxonomy breadcrumbs
Hi,
i am new to drupal. i have created one view. that view having taxonomy. i need to create breadcrumb that view. plz give me any video reference for taxonomy breadcrumbs in views
remove link
i have breadcrumb like 'plugins>marketing>temp' how to remove breadcrumbs links execept plugins