Q: How do I arrange for the taxonomy term description text to be displayed when I use the built in 'taxonomy_term' view to handle the display of my taxonomy lists?
A: You can get the text to display by enabling the view's header and adding in some PHP code which queries and displays the text...
The 'taxonomy_term' view is a fantastic alternative to drupal's built in taxonomy display mechanism. You can use it to customise the living daylights out of your taxonomy display, especially if you use it in conjunction with modules like [url=http://drupal.org/project/taxonomy_image]Taxonomy Image[/url]. We have used it a lot recently on our web sites when the web design calls for displaying grids of products with product pictures and the like.
Anyway, the view has one small problem in that it doesn't display the taxonomy term's description text at the top of the page in the way that the default taxonomy display method does.
After some searching we found a way to easily get the view to display the description text here (see the comment on Nov. 2008 by Guix):
http://www.norio.be/blog/2008/10/displaying-taxonomy-term-description-top-drupal-view
Here are the steps we used:
[img]/sites/default/files/images/tax-description.png[/img]
(1) Enable the view's Header
(2) Set the header's input format to PHP
(3) Paste in Guix's PHP code:
<code>
<?php
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$tid = (int)arg(2);
$term = taxonomy_get_term($tid);
print (filter_xss_admin($term->description));
}
?>
</code>
This code gets the taxonomy term id from the url, uses it to load the corresponding taxonomy term and then pulls out and prints the term description text.
(4) Press Update & Save View
Now when the view is displayed it should insert the taxonomy description txt at the top.
It worked really well for us and we're very grateful to Guix for the tip - cheers, it really helped us out!