Textpattern CMS Template Tags

<txp:if_article_section /> container tag, 1 attributes

if_article_section

The if_article_section tag is a conditional tag and always used as an opening and closing pair, like this…

<txp:if_article_section>
...conditional statement...
</txp:if_article_section>

The tag will execute the contained statements if the section name associated with a particular article matches the value of the name attribute. Should be used in an article form.

attributes

name="unset" 
  • Comma-separated list of section names.
<txp:if_article_section /> 2 examples

Check the article’s section

<txp:if_article_section name="Poetry">
<p>by <txp:author /></p>
</txp:if_article_section>

What this does…
Displays the author name if the current article belongs to the section named Poetry.

Other tags used: author

Using the tag with else

<txp:if_article_section name="Poetry">
<p>Fun With Poetry</p>
<txp:else />
<p><a href="index.php">Home</a></p>
</txp:if_article_section>

What this does…
Display the welcome text if the article’s section matches Poetry, or shows a default link otherwise.

Other tags used: else