Hello,
I try to create a hierarchical taxonomy breadcrumb for a specific node type.
Here is the example. This is my taxonomy
[Vocabulary]
- Term 1
- Sub Term 1
- Sub Sub Term 1
- Sub Sub Term 2
- Sub Term 2
- Sub Term 3
- Term 2
etc...
Lets imagine that my node is associated to the Sub Sub Term 2.
I would like a breadcrumb like this : Home > Term 1 > Sub Term 1 > Sub Sub Term 2 > Node title
So, concretely, I want that all parent terms become a breadcrumb item.
Not sure what is the token I should use to get that results.
Any help would be greatly appreciated :)
Regards,
Alex
Comments
Comment #1
spleshkaHi,
See how to do that on the screenshot: http://drupalace.ru/sites/default/files/pictures/path_breadcrumbs_0.png
Your breadcrumbs should look like that (field-category is field in node with taxonomy terms):
Comment #2
zmove commentedHi, thank you for your answer.
So, if I don't know what is the future size of the taxonomy hierarchy, I have to repeat that many times to be sure that all the path will be covered ?
Would it be possible to have a token to make a loop into the hierarchy, to cover all possible levels in one line ?
Regards,
Alex
Comment #3
spleshkaUnfortunatelly, for now it is not possible. But I will work on this problem after some bundle of more important features.
Comment #4
petu commentedHello guys!
This case is also actual for me.
I have a solution. Add a breadcrumb's "rule" for each level and show one of them for current depth.
So, you should:
It determines the term's depth by tid.
where the number is the depth.
Note: you should adopt
$contexts['tid']->data->tidfor your case. in my case I use taxonomy terms as a page.Use dsm($contexts) from devel module to find out how to get tid.
In spite of this solution, I'm waiting for the functionality with a loop into the hierarchy from Eugeniy!
Comment #5
Tony Finlay commentedI have a similar issue.
I have a content type called: "project".
Within that content type there is a taxonomy field called "field-project-type"
I want my breadcrumb to show the following:
projects/field-project-type-name/project-title
Below is what I currently have, but it throws up a white screen:
Cheers in advance for any help.
Comment #6
mropanen commentedI can't get tokens (or keywords or whatever these are called in ctools) like %node:field-section:name or %node:field-section:url to work at all, and because of this the solution in #1 doesn't work.
Here :field-section is a taxonomy term in the node.
What it returns is "Name of the term":name and "Name of the term":url
I have Entity API and Entity Tokens 1.0 enabled.
Comment #7
spleshkaTry to update to the latest Ctools dev.
Comment #8
mropanen commentedThank you, I hadn't realized the latest stable release was so old. Works perfectly now :)
Comment #9
Lemontonix commentedHi,
I am having a similar issue. I am trying to use PB together with Advanved Forum.
The forum is nothing more than nodes having a hierierchial taxonomy based structure.
My breadcrumbs look like this:
Breadcrumbs only contain the %forum:name but not the taxonomy path.
Does anyone know what the problem is? Thanks.
Comment #10
vlad.dancerHi, guys!
Here code that works for me:
I hope this solution helps someone.
Comment #11
kalabroJust added support for new token "pb-join" which works only with taxonomy terms and adds full taxonomy hierarchy to breadcrumbs.
:name and :url tokens now have to be used in combination.
Result:
Commited to 7.x-3.x: http://drupalcode.org/project/path_breadcrumbs.git/commitdiff/a262c70211...
Comment #12
OnkelTem commentedpb-join adds the link to the current term while Drupal default behavior is NOT to have current page in the breadcrumbs. This should be an option.
Also, I tried to emulate not adding current page by providing %term:parent:0:pb-join:name(or url), but this doesn't work for some reason.
Comment #13
kalabro@OnkelTem,
try
%term:parent:pb-join:nameand%term:parent:pb-join:urlwithout number suffixes.Comment #14
OnkelTem commentedThank you very much! It works. But why it's not expanded like that when selecting via UI?
Comment #15
kalabro@OnkelTem, not all tokens fully expanded in UI. We are working on it. I've fixed ":parent:" token in latest dev: http://drupalcode.org/project/path_breadcrumbs.git/commit/2a69359
Comment #17
selinav commentedHello
I have the same problem. I've read the documentation and I don't understand the right syntax,
I have a content type "produit" with taxonomy term with only one level (field_tags).
When I try to enter this, nothing display
%node:field_tags:pb-join:name and %node:field_tags:pb-join:urlWhat is wrong ?
Thanks for your help
Comment #18
selinav commentedHere my settings, is-it good ?
Comment #19
kalabroHello, @selinav!
What do you expect to see?
field_tagsusually is array of multiple terms:So tokens are provided in this way:
%node:field_tags:0:name/%node:field_tags:0:urlfor the first tag.%node:field_tags:1:name/%node:field_tags:1:urlfor the second tag.And so on.
pb-joindoesn't implode tags in this manner "tag1, tag2, tag3". This token is used for outputting term parents.Comment #20
selinav commentedI have succeed, my problem is due to an error of the name field.
In content type "produit", the name is "field_tags" but the syntax use for path breadcrumb is "field-tags".
I've entered this :
%node:field-tags:0:i18n-nameand%node:field-tags:0:urlThank you for your quick reply and the explanation.
Comment #21
grenuy commentedСколько времени прошло, а помогло) спасибо