Go to main content

If article section




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

    …conditional statement…

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.


Tag will accept the following attributes (case-sensitive) as well as the global attributes :

One or more section names separated by a comma.
Example : name="section,section2,etc"


Example 1: Check the article’s section

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

Displays the author name if the current article belongs to the section named poetry.

Other tags used: author.

Example 2: 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>

Display the welcome text if the article’s section matches poetry, or shows a default link otherwise.

Other tags used: else.

If you notice any kind of problem with this page's construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)