You are here:
themes
Taxonomy terms in contemplate template.
Enter the following within your customised template.
<?
$taxonomy_terms = $node->taxonomy;
foreach ($taxonomy_terms as $term) {
$faq_tags .= ", $term->name";
}
$faq_tags = substr($faq_tags,1);
?>
The variable $faq_tags is now available listing the terms separated by commas.
Taxonomy terms in page.tpl.php
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;
Taxonomy terms in page.tpl.php
function YourThemeName_preprocess_page(&$variables) {
foreach($variables['node']->taxonomy AS $tax_term) {
$variables['wowzers'] .= ", $tax_term->name";
}
$variables['wowzers'] = substr($variables['wowzers'],1);
}
After entering this in your template.php file the variable $wowzers will be availble for use within your page.tpl.php file.
Please note you can only use one preprocess function per template.tpl.php file.
Drupal logo template tpl php
An example is shown below:
<div id="logo">
<?
if ($logo): ?>
<a href="<? print $base_path; ?>" title="<? print t('Click to return to the Homepage'); ?>"><img src="<? print $logo; ?>" alt="<? print t('Click to return to the Homepage '); ?>" /></a>
<? endif; ?>
</div>

