Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.2
About It:
Get it:
Rate it:
  • Helpful?
  • 5 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

jra_link_to_next & jra_link_to_prev

These 2 article tags are replacements for link_to_next and link_to_prev which offer additional section and sort attributes to better reflect the position in the list.

Optional attributes are:

  • section, which limits the list to the section;
  • showalways, default to 0, like the txp attribute. When 0, the enclosed contents is not shown if there is no link (beginning and end of list). When 1, the contents is shown even if there’s no link. (thanks for commentors for pointing at it missing). Added v0.2.
  • sort, a SQL string which controls the ordering of the list.

The latter was my motivation for this plugin. For example, in a list defined as follows:

<txp:article section='listings' limit="6" sort="custom_7,LastMod desc"/>

once you open an article, what is prev and next?

In this case, it’s this:

<txp:jra_link_to_prev sort="custom_7,LastMod desc" section='listings'>[<< Prev]</txp:jra_link_to_prev>

and this:

<txp:jra_link_to_next sort="custom_7,LastMod desc" section='listings'>[Next >>]</txp:jra_link_to_next>

Article Request Count:
Posted here:
03 Nov 2007

You know you want to visit the Archives.
Published with Textpattern