Hi
What is the easiest way to display the current taxonomy term at the top of the box content - i.e. where the breadcrumb usually displays. I simply need the term displayed - I will be using this in combination with the 'Menus' module so that when a user clicks on a term under a vocab (in a menu block) it will list all the latest nodes under that term - however I would like the actual term to be written to the top of the page where the breadcrumb usually is.

What PHP code would I need to do this, and in what script should I put it?

Thanks!

Comments

tdailey’s picture

i made a custom taxonomy_menu_page and I display the current taxonomy term at the top of the list. To do this I just added

	print "<h2>".$term->name." - recent stories</h2>";

after the print theme("header") line.

in any event, assuming you have the current term loaded somewhere $term->name should get you the term name.

ph4nt0m-1’s picture

Hi, thanks for the suggestion. It doesn't seem as though the term has been loaded, since printing that variable produces nothing.

Whereabouts should that term be loaded?

Thanks

tdailey’s picture

for a taxonomy:
$myterm = taxonomy_get_term($taxonomy->tids[0]);

for a node (not your question, but useful):
$mynode = node_load(array("nid" => $node->nid));

$node->teaser is a useful one for nodes.