EntryIfTagged
This template tag evaluates a block of code if a tag has been assigned to the current entry in context.
If the tag
attribute is not assigned, then the template tag will evaluate if any tag is present.
Check for a specific tag…
<mt:EntryIfTagged tag="Foo">
This entry has the tag "Foo"
</mt:EntryIfTagged>
Check if any tags are assigned to the entry…
<mt:EntryIfTagged>
This entry has tags
</mt:EntryIfTagged>
Context
Attributes
tag
If present, the template tag will evaluate if the specified tag is assigned to the current entry.
include_private=”0”
Include private tag if “1” is set.
Example
Conditional if tagged “Foo” or not:
<mt:EntryIfTagged tag="Foo">
<!-- do something -->
<mt:Else>
<!-- do something else -->
</mt:EntryIfTagged>
Condition based upon if a entry is tagged with the private tag @draft:
<mt:Entries>
<li class="entry <mt:EntryIfTagged tag="@draft">draft</mt:EntryIfTagged>">
<a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
<mt:EntryIfTagged tag="@draft">(draft)</mt:EntryIfTagged>
</li>
</mt:Entries>