put this in the template.php ->
=========================================================
function _phptemplate_variables($hook, $vars = array()) {
switch ($hook) {
case 'page':
if (arg(0) == 'taxonomy') { //check to see if this is a taxonomy page
$vars['term_description'] = ''; //create a new template variable
$vars['vocab_description'] = ''; //create a new template variable
$a2 = arg(2); //get the term id
if(is_numeric($a2)) {
$result = db_query(db_rewrite_sql("SELECT vid, description FROM {term_data} td WHERE td.tid = %d"), $a2);
$this_term = db_fetch_object($result);
//save the term description
$vars['term_description'] = $this_term->description;
$vocab_result = db_query(db_rewrite_sql("SELECT description FROM {vocabulary} WHERE vid = %d LIMIT 1"), $this_term->vid);
$this_vocab = db_fetch_object($vocab_result);
//save the vocabulary description
$vars['vocab_description'] = $this_vocab->description;
}
}
break;
}
return $vars;
}
put this in page.tpl.php ->
=========================================================
(replace the #php with ?php ;)
<#php if (!empty($vocab_description)) { ?>
<#php } ?>
<#php if (!empty($term_description)) { ?>
<#php } ?>

Post new comment