I realise that this is similar to other questions posted, but they all seem to involve using print l() to output a fully formed anchor.

What I need is just the uri, output in plain text to use directly in the node template. I nearly got there with the following, but end up with the unaliased version:

  if (isset($node->field_source_of_tid['und'][0]['tid']) && $node->field_source_of_tid['und'][0]['tid']) :
    $term_uri = taxonomy_term_uri($term);
    $output = $term_uri['path'];
endif; ?>

And I use the output as so:

<a href="<?php print render($output); ?>">A BUTTON </a>

Any ideas?



You're probably looking for url()

Generates an internal or external URL.


$output = url($term_uri['path']);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.