Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.8
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2010 at 22:25 UTC
Updated:
13 Nov 2010 at 21:20 UTC
This took me a while to figure out so I thought I put it up for inclusion into the Views Documentation. I have a view with arguments based on Taxonomy (TermID) and I needed to put the Term Description below the header. Under Arguments |Taxonomy: Term, I set the title to %1. Under Basic Settings | Header, I put the following PHP code:
<?php
$term_name = arg(1);
$matching_terms = taxonomy_get_term_by_name ($term_name);
if (count($matching_terms) > 0) {
print '<p>'. $matching_terms[0]->description . '</p>';
}
?>
Hopefully it can help someone else out as it took me days to figure it out :-)
Comments
Comment #1
dawehnerShould be better :)
Comment #2
rschwab commentedThanks for adding that to the d.o knowledge base wavesailor! I'm sure people working with views and taxonomy will appreciate it.