Iain Urquhart



Fetches the node's url according to Taxonomy from a given entry_id

{exp:taxonomy:node_url entry_id='{entry_id}' tree_id='1'}

Example output:


Tag Parameters



The id of the tree you want to fetch



The entry_id of the node to return the url for



The node_id of the node to return the url for



Hide/remove default template group from urls generated by Taxonomy.


If you find the following markup unsightly:

<a href="{exp:taxonomy:node_url entry_id='{entry_id}' tree_id='1'}">{title}</a>

Create a new snippet with the name taxonomy_url_title with the tag {exp:taxonomy:node_url entry_id='{entry_id}' tree_id='1'} as the Variable Content

This will 'clean' the above markup to:

<a href="{taxonomy_url_title}">{title}</a>

Remember though, in this example, we're specifying the tree id, so if you want to use for multiple trees, you'll need to create multiple snippets.


The first time the tag is called, it stores an array of each node [entry_id] => [node_url] in the user's session. Each subsequent request is accessed directly from there so the amount of queries from 20 instances of this tag on the same page is at most, 1 query.

It's also worthwhile noting that so long as a node exists for the entry, the url generated by this tag will keep itself updated should the template names be updated, or the url_title of the entry be updated.

This tag should also work in search results to bring the user to the correct template as specified in Taxonomy. However, you may need create a workaround with conditionals if you have multiple trees using the same weblogs.

Want to say 'thank you'?

If you find any of my work useful, feel free to make a donation amount of your choosing via PayPal — or if you like, purchase a copy of Introvert from Devot-EE and you'll get something in return :)

↑ Back to top