Go to main content

Expires

Contents

Syntax

<txp:expires />

The expires tag is a single tag used to indicate when an article should no longer appear in a site, particularly when the information is date sensitive (e.g. events like conferences, meetings and so forth). The tag is defined by expiration date values that are set under the ‘‘Date and time’ area of the Write panel.

Attributes

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

format="format string"
Override the default date format set in the Preferences panel.
Values: any valid strftime string values.
Default: the ‘Archive date format’ set in preferences.
gmt="boolean"
Return either local time (according to the set time zone preferences) or GMT.
Values: 0 (local time) or 1 (GMT).
Default: 0.
lang="ISO language code"
Format time string suitable for the specified language (locale).
Values: locales adhere to ISO-639.
Default: unset (time format set in the Preferences panel.

Examples

Example 1: Custom format date setting

<p>
    Expires:
    <txp:expires format="%b %d, %Y" />
</p>

This would result in the following HTML output:

<p<Expires: Feb 03, 2014</p>

Example 2: Extended custom format date setting

<p>
    Expires:
    <time datetime="<txp:posted format="iso8601" />">
        <txp:posted class="time-day" wraptag="span" format="%d" />
        <txp:posted class="time-month" wraptag="span" format="%b" />
        <txp:posted class="time-year" wraptag="span" format="%Y" />
    </time>
</p>

This would result in the following HTML output, which provides styling hooks for each date part:

<p>
    Expires:
    <time datetime="2014-02-03T10:43:39Z">
        <span class="time-day">03</span>
        <span class="time-month">Feb</span>
        <span class="time-year">2014</span>
    </time>
</p>

Genealogy

Version 4.0.7

Tag support added.

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. :)