If first image

On this page:

Syntax

<txp:if_first_image>

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

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

The tag will execute the contained statements if the displayed image is the first in the currently displayed images list. The tag supports else.

Attributes

This tag has no attributes.

Examples

Example 1: Identify first image in an image list

<txp:images break="" wraptag="ul" sort="date desc">
    <txp:if_first_image>
        <li class="latest">
            <txp:image /> (Latest photo)
        </li>
    <txp:else />
        <li>
            <txp:image />
        </li>
    </txp:if_first_image>
</txp:images>

Other tags used: else, image, images.

Genealogy

Version 4.6.0

Tag support added.

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.