If article list

On this page:

Syntax

<txp:if_article_list>

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

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

The tag will execute the contained statement if an article list is being displayed (i.e. not showing an individual article).

Attributes

This tag has no attributes.

Examples

Example 1: Article/article list navigation

<txp:article />

<txp:if_individual_article>
    <p>
        <txp:link_to_prev>
            <txp:prev_title />
        </txp:link_to_prev>
        <txp:link_to_next>
            <txp:next_title />
        </txp:link_to_next>
    </p>
</txp:if_individual_article>

<txp:if_article_list>
    <p>
        <txp:older>Previous</txp:older>
        <txp:newer>Next</txp:newer>
    </p>
</txp:if_article_list>

This example shows how to setup article navigation so that link_to_prev and link_to_next are used at the individual article level or older and newer with article lists.

Other tags used: link_to_prev, link_to_next, prev_title, next_title, if_individual_article, older, newer.

Example 2: In combination with the ‘else’ tag

<txp:if_article_list>
    <p>
        <txp:site_name />
    </p>
<txp:else />
    <p>
        <img src="http://example.com/logo.png" alt="Logo">
    </p>
</txp:if_article_list>

This example shows the if_article_list in combination with else to display a site’s site_name or logo when an article list is displayed or not, respectively.

Other tags used: else, site_name.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.