Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.384 diff -u -p -r1.384 taxonomy.module --- modules/taxonomy/taxonomy.module 2 Oct 2007 16:15:56 -0000 1.384 +++ modules/taxonomy/taxonomy.module 9 Oct 2007 11:14:50 -0000 @@ -21,6 +21,9 @@ function taxonomy_theme() { 'taxonomy_term_select' => array( 'arguments' => array('element' => NULL), ), + 'taxonomy_term_description' => array( + 'arguments' => array('term' => NULL), + ), ); } Index: modules/taxonomy/taxonomy.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v retrieving revision 1.2 diff -u -p -r1.2 taxonomy.pages.inc --- modules/taxonomy/taxonomy.pages.inc 27 Sep 2007 16:52:00 -0000 1.2 +++ modules/taxonomy/taxonomy.pages.inc 9 Oct 2007 11:19:24 -0000 @@ -27,6 +27,9 @@ function taxonomy_term_page($str_tids = if ($names) { $title = check_plain(implode(', ', $names)); drupal_set_title($title); + + // Fetch description of first term. + $term = taxonomy_get_term($tids[0]); switch ($op) { case 'page': @@ -40,16 +43,16 @@ function taxonomy_term_page($str_tids = $breadcrumbs = array_reverse($breadcrumbs); menu_set_location($breadcrumbs); - $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE)); + $output = theme('taxonomy_term_description', $term); + $output .= taxonomy_render_nodes(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; + $channel['description'] = theme('taxonomy_term_description', $term); $result = taxonomy_select_nodes($tids, $terms['operator'], $depth, FALSE); @@ -59,6 +62,7 @@ function taxonomy_term_page($str_tids = node_feed($items, $channel); break; + default: drupal_not_found(); } @@ -70,6 +74,16 @@ function taxonomy_term_page($str_tids = } /** + * Format a taxonomy term description for a term page view or feed output. + * + * @param object $term + * A taxonomy term object. + */ +function theme_taxonomy_term_description($term) { + return check_markup($term->description, FILTER_FORMAT_DEFAULT, FALSE); +} + +/** * Helper function for autocompletion */ function taxonomy_autocomplete($vid, $string = '') {