Newer
Contents
Syntax
<txp:newer />
The newer tag is both a single tag and a container tag. Textpattern will replace this tag with a link to the next list of articles in the sort order. As a single tag it outputs the URL for the next list page. If used as a container, it will wrap the text or tag assigned to the link.
An article list consists of the assigned number of articles set by the article tag. If there are no articles available having ‘Newer’ status (articles ranked higher, or later, in the present sort criteria than the article shown at the top of the present list) <txp:newer />
will not display unless the showalways
attribute is set. It is normally used in tandem with older or pages.
Given a <txp:article limit="5" />
tag on the page in question, <txp:newer />
will page up five articles at a time from the oldest post forward in time to the most recently posted article.
Note: This tag is context-sensitive, meaning it will only fetch content from the section or category being viewed.
Attributes
Tag will accept the following attributes (case-sensitive) as well as the global attributes :
rel="text"
v4.7.0+- HTML rel attribute to be applied to link.
- Default: unset.
showalways="boolean"
- Show wrapped value even when no older page exists.
- Values:
0
(no) or1
(yes). - Default:
0
. title="text"
v4.3.0+- HTML title attribute to be applied to link.
- Default: unset.
Examples
Example 1: Container tag - link with text
<txp:newer rel="prev">Newer</txp:newer>
or, to render the text in the current site language:
<txp:newer rel="prev"><txp:text item="newer" /></txp:newer>
Example 2: Single tag - link with image
<a href="<txp:newer />">
<txp:image name="right-arrow.gif" />
</a>
Other tags used: image.
Example 3: Container tag - link with image
<txp:newer>
<txp:image name="right-arrow.gif" />
</txp:newer>
The difference between examples 2 and 3 is that the tags in example 2 will display the image even if there are no newer articles, those used in example 3 won’t.
Other tags used: image.
Genealogy
Version 4.7.0
rel
attribute added.
Version 4.3.0
title
attribute reintroduced after being accidentally removed.
escape
attribute added.