Community & Support

My theme attempt of theme_taxonomy_term_page

In an attempt to change the $depth, I did an override of theme_taxonomy_term_page (from line 88 of taxonomy.pages.inc) by placing the code in my template.php file. I added one line and set the value of $depth (the code I got from line 44 of taxonomy.pages.inc).

Works so far, have not discovered any problems. ALTHOUGH, I am wondering if this not good, maybe not safe code, will it cause overload of something? I'm using D6.9, do not want to use many contributed add-on modules (views is one), basic understanding of PHP (learning it, still weak at writing it). Seeking any expert opinions and insight. THANKS MUCH!

function mytheme_taxonomy_term_page($tids, $result) {
$result = taxonomy_select_nodes($tids, $terms['operator'], $depth = all, TRUE); // added this line
drupal_add_css(drupal_get_path('module', 'taxonomy') .'/taxonomy.css');

$output = '';

// Only display the description if we have a single term, to avoid clutter and confusion.
if (count($tids) == 1) {
$term = taxonomy_get_term($tids[0]);
$description = $term->description;

// Check that a description is set.
if (!empty($description)) {
$output .= '';
$output .= filter_xss_admin($description);
$output .= '';
}
}

$output .= taxonomy_render_nodes($result);

return $output;
}

Comments

Thank you for this... I don't

Thank you for this... I don't know what you mean by $depth but the technique was useful for solving a problem I've had for over 2 years. See: Improving navigability of Drupal taxonomy hierarchies

nobody click here