2

Per documentation I am getting a selected tag:

{% set tag = entry.myTagsField.first() %}

How to check if its name is equal to "Flower"?

1 Answer 1

4

Your code returns an TagModel and saves it as "tag". You can now get all model properties like this:

{{ tag.property_name }}

In your case it would look like this:

{% if tag.name == 'Flower' %}
    Do stuff
{% endif %}
0

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.