All pastes #939090 Raw Edit

taxonomy parents

public text v1 · immutable
·published 2008-03-12 01:13 UTC
rendered paste body
<?php
global $conf;

foreach($node->taxonomy as $term) {
	if ($term->vid == $conf['uc_catalog_vid']) {
		$tree = taxonomy_get_parents_all($term->tid);
		break;
	}
}
if (isset($tree)) {
	$tree = array_reverse($tree);
	foreach($tree as $term) {
		$links[] = l($term->name,drupal_get_path_alias(taxonomy_term_path($term)));
	}
	$links[] = "<span>{$node->title}</span>";
	echo '<div class="product_collection_tree">' . implode(' / ',$links) . '</div>';
}
?>