0

In my site I have pages with a single vocabulary called "category" and Custom Breadcrumbs displays the taxonomy hierarchy and it works. enter image description here Another content types has several vocabularies, including "category". But here Custom Breadcrumbs (CB) will not use the category but other vocabulary to generate the trail.

If I exclude the vocabularies I don't want CB to use to only allow "category", then no breadcrumb is displayed.

enter image description here

The only difference I see between those content types is the order in which I have created fields. Category was the last field I created for my second content type

So how can I force CB to use category as vocabulary ?

1

I had the same problem on my site. I managed to fix it the hard way.

Edit custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.inc

Add these lines after line 20:

$query->condition("v.vid", 2); // 2 is the id of vocab You want to use
$query->orderBy('v.weight');
$query->orderBy('t.weight');
$query->orderBy('t.name');

So You have:

...
$t_alias = $query->join('taxonomy_term_data', 't', 'r.tid = t.tid');
$v_alias = $query->join('taxonomy_vocabulary', 'v', 't.vid = v.vid');
$query->fields( $t_alias );
$query->condition("r.nid", $node->nid);
$query->condition("v.vid", 2);
$query->orderBy('v.weight');
$query->orderBy('t.weight');
$query->orderBy('t.name');
$result = $query->execute();
$terms[$node->vid][$key] = array();
...
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.