0

I am trying to print taxonomy terms using this code:

<?php foreach ((array)$taxonomy as $item) { ?>
<a href="<?php print base_path() . "taxonomy/term/" . $item->tid; ?> "class='tags'><?php print $item->name ?>,</a>
<?php } ?>

It works fine in teaser, however it doesnt in the full node, the tags are empty in the full node. Can any one tell me what is the reason for this and how to fix this?

Vonder
  • 4,033
  • 15
  • 44
  • 61

1 Answers1

0

I realize this is an old question, but I'd like to post my Drupal 6 solution.

Use this

$tree = taxonomy_get_tree($vid);

Then loop through it to print out the terms:

      foreach ($tree as $term) {
       $path = taxonomy_term_path($term);
       $content .= '<a href="<?php print base_path() . strtolower(str_replace( " ", "-",$term->name)) . '">' . $term->name . '</a>';           
  }
Jason Glisson
  • 1,031
  • 7
  • 10