This module is great; it has solved a big coherence problem in my site, providing me with a logical navigation scheme. But I would need -and I think that most of you too- the same features of node breadcrumb module applied to vocabulary and term pages. Summing, I would need to tie vocabulary and term pages to concrete menu trails. For example:

- All terms related to vocabulary "Apples" tied to "Fruits > Apples" menu item (Vocabulary based)

- Each term related to vocabulary "Cars" tied to each secondary item of the "Cars" primary menu item (Term based)

Could this be done? Now, when my visitors enter to a term page, my whole menu appears deactivated!

Comments

bdimaggio’s picture

For what it's worth, Taxonomy Menu (http://drupal.org/project/taxonomy_menu) does this. However, I've found out the hard way that node breadcrumb doesn't work when taxonomy menu is installed...

noah’s picture

This is an old request, but I have a snippet that works with 6.x-1.0-beta6 that solves the second of these requests. It would be great to have it in the module, but until then this should work if someone's looking for the same thing.

Add this function to a custom module:

function [module]_taxonomy_path($node, $term) {
	$return = FALSE;
	if ($node->taxonomy) {
		$tids = array();
		foreach ($node->taxonomy as $tid => $term_data) {
			if ($term_data->name == $term) $return = TRUE;
			$tids[] = $tid;
		}
		if ((!$return) && (!empty($tids))) {
			foreach ($tids as $tid) {
				$ancestors = taxonomy_get_parents_all($tid);
				foreach ($ancestors as $ancestor) {
					if ($ancestor->name == $term) $return = TRUE;
				}
			}
		}
	}
	return $return;
}

Then in the "Condition" (additional PHP expressions) field for node_breadcrumb, call:

[module]_taxonomy_path($node, [term])

...where "term" is the term you want to match against -- this will match that term and any descendants of that term.

There are a lot of "foreach" loops in there -- I'm open to suggestions for better ways of finding a match. There may be a built-in taxonomy function I've overlooked.