Created
January 30, 2014 10:22
-
-
Save csakiistvan/8705885 to your computer and use it in GitHub Desktop.
load term from field, and print as a link in preprocess page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function basetheme_preprocess_page(&$vars) { | |
| $term = taxonomy_term_load($vars['node']->field_name_topic['und']['0']['target_id']); | |
| $term_uri = taxonomy_term_uri($term); // get array with path | |
| $term_title = taxonomy_term_title($term); | |
| $term_path = $term_uri['path']; | |
| $link = l($term_title,$term_path); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment