Taxonomy terms in page.tpl.php

Category
drupal, taxonomy, themes
Date Created
8th Jan 2010
Last Updated
9th Jul 2010

Taxonomy terms in page.tpl.php

Question

How to make taxonomy terms availble to template.tpl.php

Answer

Within your page.tpl.php file enter the following:

if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) {
$node = node_load(arg(1));
$taxonomy_terms = $node->taxonomy;
foreach ($taxonomy_terms as $term) {
$faq_tags .= ", $term->name";
}
}
$faq_tags = substr($faq_tags,1);

print $faq_tags;

Related terms