Taxonomy breadcrumb token
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
About
Core and contrib tokens already do a great job in providing precious meta information on Drupal entities. However, creating a hierarchical breadcrumb from the root term down (or up) to and especially including the current term with a single token is impossible unless you wanted to create custom code snippets as a workaround.
This module is intended to fill just this gap as handy as possible and thus introduces two additional term related tokens:
- [term:breadcrumb]
- [term:breadcrumb-reverse]
Where the first one returns an array starting with the root term, the latter starting with the current term.
Requirements
All you need is:
- Enable core taxonomy module (you would not be here without that!)
- token module
Quick reference
Just enable the module and create some tokenizable content. You will find the two new tokens in the token browser, supporting all array-related options the token module offers.
Example
If you have a hierarchichal vocabulary like this one:
[Vocab]
|
+- Grocery
|
+- Vegetables
|
+- Fruits
| |
| +- Apples
| |
| +- Pears
|
+- Drinks
Then inserting [term:breadcrumb:join: > ] e.g. as page title in the metatag module would result in Grocery > Fruits > Apples while [term:breadcrumb-reverse:join: / ] would deliver Apples / Fruits / Grocery.
Credits
D7 development sponsered by Compuccino GmbH.
