3

I want to display an entry's tag next its title in a list of entries, and on the entry's detail page. For example, for a blog. How do I do that?

1
  • Same goes for categories? {% for category in entry.categoryField %} {{ category }} {% endfor %} And how would we separate tags/categories with commas? Cheers, Rey
    – user427
    Jun 28 '14 at 12:24
6

To list all tags on a particular entry use:

{% for tag in entry.tagField %}
    {{ tag }}
{% endfor %}

If you only want the first tag you can just use:

{{ entry.tagField.first }}

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.