Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.385 diff -u -p -r1.385 taxonomy.module --- modules/taxonomy/taxonomy.module 27 Oct 2007 13:39:07 -0000 1.385 +++ modules/taxonomy/taxonomy.module 3 Nov 2007 17:24:26 -0000 @@ -21,6 +21,9 @@ function taxonomy_theme() { 'taxonomy_term_select' => array( 'arguments' => array('element' => NULL), ), + 'taxonomy_term_page' => array( + 'arguments' => array('tids' => array(), 'result' => NULL), + ), ); } Index: modules/taxonomy/taxonomy.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v retrieving revision 1.3 diff -u -p -r1.3 taxonomy.pages.inc --- modules/taxonomy/taxonomy.pages.inc 25 Oct 2007 08:24:43 -0000 1.3 +++ modules/taxonomy/taxonomy.pages.inc 3 Nov 2007 17:26:53 -0000 @@ -3,7 +3,7 @@ /** * @file - * Administrative page callbacks for the taxonomy module. + * Page callbacks for the taxonomy module. */ /** @@ -41,16 +41,20 @@ function taxonomy_term_page($str_tids = $breadcrumb = array_reverse($breadcrumb); drupal_set_breadcrumb($breadcrumb); - $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE)); + $output = theme('taxonomy_term_page', $tids, taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE)); drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'), 'RSS - '. $title); return $output; break; case 'feed': - $term = taxonomy_get_term($tids[0]); $channel['link'] = url('taxonomy/term/'. $str_tids .'/'. $depth, array('absolute' => TRUE)); $channel['title'] = variable_get('site_name', 'Drupal') .' - '. $title; - $channel['description'] = $term->description; + // 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]); + // HTML will be removed from feed description, so no need to filter here. + $channel['description'] = $term->description; + } $result = taxonomy_select_nodes($tids, $terms['operator'], $depth, FALSE); @@ -60,6 +64,7 @@ function taxonomy_term_page($str_tids = node_feed($items, $channel); break; + default: drupal_not_found(); } @@ -71,6 +76,30 @@ function taxonomy_term_page($str_tids = } /** + * Render a taxonomy term page HTML output. + * + * @param $tids + * An array of term ids. + * @param $result + * A pager_query() result, such as that performed by taxonomy_select_nodes(). + */ +function theme_taxonomy_term_page($tids, $result) { + $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]); + $output .= '
'; + $output .= filter_xss_admin($term->description); + $output .= '
'; + } + + $output .= taxonomy_render_nodes($result); + + return $output; +} + +/** * Helper function for autocompletion */ function taxonomy_autocomplete($vid, $string = '') {