I have created a block to show the sibling terms of the term being viewed. In the twig template I am looping through the terms to display the names linked to their respective pages.

Now I unable to figure out how to get path alias.

Can any one of you please guide me how to get the path alias of a term?


1 Answer 1


A bit late, but just figured this one out in case it helps someone else:

{{ path('entity.taxonomy_term.canonical', {'taxonomy_term': tid}) }}
  • Thank you for providing an answer. It is often nice to enclose code in code formatting. This can be done by indenting multi-line code with 4 or so spaces, or enclosing a single line with backticks.
    – mradcliffe
    May 26, 2017 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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