I would like to add a link in my template to the view page "taxonomy term", for a term of taxonomy to partiluer.

For example, in my taxonomy "thing" I have the term "truc", and I would like the link redirect to the page of the term taxonomy "truc".

I tried <a href="{{ path('view.taxonomy_term.page_1') }}">{{ 'Name'|t }}</a> but of course it does not work because I do not know where to put the term in question (in example the term "truc").

Do you know how to do it ?


Try this one

<a href="{{ path('entity.taxonomy_term.canonical', {'taxonomy_term' => term_id}) }}">{{ 'Name'|t }}</a>

Where term_id is your taxonomy term id.

| improve this answer | |

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.