Print Taxonomy Term Url with list

 

{% for item in node.field_category %}

<a href="{{ path('entity.taxonomy_term.canonical', {'taxonomy_term': item.entity.tid.value}) }}">{{ item.entity.name.value }}</a>
{% endfor %}


Reference: https://www.drupal.org/forum/support/post-installation/2016-04-19/getting-url-of-taxonomy-term-page-from-twig-template

Comments

Popular posts from this blog

Enable Theme Debug in Drupal 9

Remove drupal 9 extensions from database

PHP redirect from http to https and www to non-www in Drupal 9