If last file

On this page:

Syntax

<txp:if_last_file>

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

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

The tag will execute the contained statements if the displayed file is the last in the currently displayed file_download_list. The tag supports else.

Attributes

This tag has no attributes.

Examples

Example 1: Identify last file in a file list

<txp:file_download_list limit="0" break="" wraptag="ul" sort="created desc">
    <txp:if_last_file>
        <li class="earliest">
            <txp:file_download_link>
                <txp:file_download_name /> (Initial release)
            </txp:file_download_link>
        </li>
    <txp:else />
        <li>
            <txp:file_download_link>
                <txp:file_download_name />
            </txp:file_download_link>
        </li>
    </txp:if_last_file>
</txp:file_download_list>

Other tags used: else, file_download_link, file_download_list, file_download_name.

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.