Get term plain text aliased url from tid 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:

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


And I use the output as so:

&lt;a href="&lt;?php print render($output); ?&gt;"&gt;A BUTTON &lt;/a&gt;


Any ideas?

Thanks!
You're probably looking for url()


  Generates an internal or external URL.


e.g. 

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