Taxonomy Terms im Block anzeigen

Um Taxonomy Terms in einem Block anzeigen zu lassen, kann man einen View erstellen oder folgenden Code benutzen.

<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) {
  if (
count($node->taxonomy) > 0) {
   
$output = '';
   
$output .= '<div class="taxonomy">';
    foreach (
$node->taxonomy as $tid => $term) {
     
$output .= l($term->name, '/taxonomy/term/' . $tid) . ' ';
    }
   
$output .= '</div>';
  }
}
?>

Kommentare

Very interesting, i like this

Very interesting, i like this website.

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.

Weitere Informationen über Formatierungsoptionen

Mit dem Absenden dieses Formulars, akzeptieren Sie die Datenschutzrichtlinie von Mollom.