2010-01-16 8 views

Antwort

15

Verwenden drupal_get_path_alias()

$path_alias = drupal_get_path_alias(taxonomy_term_path($term)); 
+11

'taxonomy_term_path()' ist nur für Drupal 6. Für Drupal 7 benutze: 'taxonomy_term_uri()' wie auch immer es ein Termobjekt haben möchte, also musst du es vielleicht so benutzen: 'drupal_get_path_alias (taxonomy_term_uri ($ term))' wobei $ term der Begriff Objekt oder du sein muss kann es mit '$ term = (object) array ('tid' => $ tid)' vortäuschen (vorausgesetzt, Sie kennen die tid!) – marblegravy

1

Sie möchten die url() Funktion sowie erkunden. Ich benutze es die ganze Zeit mit Knoten-IDs.

$node_href = url('node/'.$nid);

obwohl Sie wahrscheinlich wollen so etwas wie:

$term_href = url('taxonomy/term/' . $tid);