Hi,
I have problem forcing breadcrumbs on nodes of type product_display (a Commerce setup, each product display refers to a product entity).
Each product display has two term references on it, each term from separate vocabularies, which are: Product type and Application.
I enable user to browse through products from either category using taxonomy menus. When user hits a product_display node, I want the URL path as well as breadcrumbs indicate the Application context, regardless of from where visitor came.
My paths are performing ok. I have the following patterns:
<strong>Pattern for all Product display paths</strong>
[node:field-kateg-zastos:url:path]/[node:field-product:sku](field-kateg-zastos is a term reference field linking to the Application vocab)
<strong>Default path pattern (applies to all vocabularies with blank patterns below)</strong>
[term:vocabulary:name]/[term:parent:parent:parent:parent:parent:name]/[term:parent:parent:parent:parent:name]/[term:parent:parent:parent:name]/[term:parent:parent:name]/[term:parent:name]/[term:name](this is a long pattern with some depth overhead compared to maximum depth found in the tree)
The problem is with breadcrumbs, which always indicate the Product Type context. I tried various combinations with no desired effect. Usually I keep the "Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages" checked.
a) when I narrowed the vocabulary to only Application type, the breadcrumbs disappeared, which - to me - indicated that the other context is simply unavailable.
b) when I tried to define a Path or Node custom breadcrumb, the breadcrumbs were altered (which shows they are likely to be managed), but I had trouble setting up a smart pattern. The problem is that nodes have various branch depths throughout the tree.
I tried a similar pattern with depth overhead, but it exceeded the allowed length.
Would you suggest anything? Please let me know if you need some additional info.
Thanks for your time.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | forcing_breadcrumb_to_particular_vocabulary-1408974-5.patch | 707 bytes | g089h515r806 |
Comments
Comment #1
moniuch commentedWhat would help would be if you tested the module on a site where a node of a given type is tagged with 2 different taxonomies and you want to assign a *particular* one to be source of breadcrumbs for that type. Make sure the taxonomy is hierarchical and has variable depth at different branches. This exposes problem of defining a flexible pattern, such as Pathauto provides, which copes with variable depths.
Comment #2
zylootino commented@moniuch: I have the same issue. Did you find a suitable solution?
Comment #3
moniuch commentedYep, I gradually migrate all my sites to Path Breadcrumbs, a new powerful and actively maintained module. There you can contextually select a path branch and force to use tokens from a given taxonomy.
Comment #4
g089h515r806 commentedI solve it. in file custom_breadcrumbs\custom_breadcrumbs_taxonomy\custom_breadcrumbs_taxonomy.inc,
changge the code of function "custom_breadcrumbs_taxonomy_node_get_terms" :
This line was added by me:
Comment #5
g089h515r806 commentedHere is the patch.
Comment #6
g089h515r806 commentedIt is a bug, change status to "needs review".
(1), the term whose vocabulary's weight is lightest will be used as node's term.
(2),Site builder could change the weight of vocabulary at page admin/structure/taxonomy.
Comment #7
wemmies commentedThnx, applied the patch, changed the weight and got things the way I wanted. Things seem to work.
Not to critice (as I don't know how to code these things), but to help the thoughttrain:
A nicer sollution would be not to let it depend on weight, but on the vocab selected.
Comment #8
colanSee #1338104: Lightest vocabulary and terms not working. If there's more to do, please reopen that one.