<p>Your code returns an <a href="http://buildwithcraft.com/docs/templating/tagmodel" rel="nofollow">TagModel</a> and saves it as "tag". You can now get all model properties like this:</p>

<pre><code>{{ tag.property_name }}
</code></pre>

<p>In your case it would look like this:</p>

<pre><code>{% if tag.name == 'Flower' %}
    Do stuff
{% endif %}
</code></pre>

CC BY-SA 3.0
2014-06-13T19:14:35.893Z
2014-06-13T19:14:35.893Z
Victor
<p>Per documentation I am getting a selected tag:</p>

<pre><code>{% set tag = entry.myTagsField.first() %}
</code></pre>

<p>How to check if its name is equal to "Flower"?</p>

<tags>
How to check name of a tag
# How to check name of a tag

(Asked by: username_0 on 2014-06-13)

Per documentation I am getting a selected tag:
{% set tag = entry.myTagsField.first() %}

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

**Tags:** tags

---

## 1 answers

### Answer by username_1 on 2014-06-13. Score: 4 | Accepted answer

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 %}


---

