Skip to content

Instantly share code, notes, and snippets.

@csakiistvan
Created January 30, 2014 10:22
Show Gist options
  • Select an option

  • Save csakiistvan/8705885 to your computer and use it in GitHub Desktop.

Select an option

Save csakiistvan/8705885 to your computer and use it in GitHub Desktop.
load term from field, and print as a link in preprocess page
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