I need to render the full URL from a taxonomy term ID.


The generic way is this:

$uri = entity_uri($entity_type, $entity);
$url = $uri['path'];

So for a node, $entity_type would be 'node', and $entity would be the fully loaded node object.

Taxonomy terms are also entities in D7, so the syntax would be similar.

  • 3
    In the case of a taxonomy term, $entity_type must be set to "taxonomy_term". – kiamlaluno Apr 22 '11 at 20:23

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.