Textpattern CMS Template Tags

<txp:newer /> sing/cont tag, 1 attributes

newer

The newer tag is both a single tag and a container tag. Should be used in a page after an article tag.

Textpattern will replace this tag with an XHTML link to the next list of articles in the sort order. The container tags wrap the text or tag assigned to the link. As a single tag it outputs the URL for the next list page.

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 newer, in the present sort criteria than the present top of page article) <txp:newer> will not display unless the showalways attribute is set to 1. It is normally seen used in tandem with older.

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 grab content from the section or category being viewed.

attributes

showalways="0" (boolean) 
  • Show wrapped value even when no newer page exists.
<txp:newer /> 4 examples

Container tag: link with text

<txp:newer>Newer</txp:newer>

Single tag: link with image

<a href="<txp:newer />"><txp:image name="right-arrow.gif" /></a>

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

Container tag: link with div wrapper

<txp:newer>
   <div class="nav-link">
      <a href="<txp:newer />"><txp:text item="newer" /></a> &raquo;
   </div>
</txp:newer>

A few things to note about this example:

  • The entire container is only output if there is newer content
  • The link and div wrapper are constructed manually
  • The anchor only encompasses the textual part, leaving the arrow outside

Other tags used: text