2

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?

Thanks

1 Answer 1

9

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

{{ path('entity.taxonomy_term.canonical', {'taxonomy_term': tid}) }}
1
  • 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
    Commented May 26, 2017 at 12:19

Your Answer

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

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