soo_page_numbers
Summary:
Article list navigation and page count widgets
(If it won’t install try the compressed version)
Full plugin help text
Courtesy soo_plugin_display
soo_page_numbers
This is a plugin for Textpattern. It displays customisable navigation widgets for article list pages.
Overview
Display page navigation widgets and information for article list pages. (Inspired by rsx_page_number
, an old plugin from Txp’s early days.)
Version 0.3.0 includes a Textpack to localize pre-formatted text output such as “Page {current} of {total}”. Currently includes 21 languages.
NB: Version 0.4.0 did away with the requirement for an external library plugin, but by moving to native Txp URI handling this changed behavior on sites with custom URI schemes. 0.4.1 restores that behavior. Note that the p
(image ID) query parameter is not preserved; this is intentional.
Note: If you have more than one pagination-capable tag on the page (article
if not status="sticky"
, or any of images
, file_download_list
, or linklist
if both limit
and pageby
are set) soo_page_numbers will take its values from the first such tag. This is true no matter where you put any soo_page_numbers tags.
Tags
soo_page_links
Display a “Google-style” page navigation widget, i.e., a group of numbered links representing pages.
<txp:soo_page_links />
Attributes
placeholder
(text) default…
Text to place on either end of the central page range (when there are many pages)window_size
(integer) default5
Size of central page rangeshowalways
(boolean) default0
Whether or not to show anything when the list is a single pageactive_class
(HTML class) defaulthere
Class for the current page number’s tag (thebreak
tag, if any, otherwisespan
)wraptag
(text) default empty
HTML tag name (no brackets) to wrap the outputclass
(text) default empty
HTML class name for thewraptag
.html_id
(text) default empty
HTML id for thewraptag
.break
(mixed) default empty
HTML tag name (no brackets) to wrap or text to place between adjacent page numbers. Ifwraptag
andbreak
are set,break
is assumed to be a tag name. Otherwise it is treated as text (so don’t usebreak="br"
).
soo_page_count
<txp:soo_page_count />
Attributes
format
(format string) default"{prev} Page {current} of {total} {next}"
Tag will output this string (in your language, if among the 21 included) after replacing{prev}
,{next}
,{first}
, and{last}
with links, and{current}
and{total}
with page numbersprev
(text) default«
(«)
Link text for the{prev}
linknext
(text) default»
(»)
Link text for the{next}
linkfirst
(text) default|«
(|«)
Link text for the{first}
linklast
(text) default»|
(»|)
Link text for the{last}
linkshowalways
(boolean) default0
Whether or not to show{prev}
and{next}
on the first and last pages, respectively, or anything at all when the list is a single pagewraptag
(XHTML tag name, no brackets) optional tag to wrap the output
soo_prev_page, soo_next_page
Shortcuts for soo_page_count
when all you want is a single link. For example, soo_prev_page
is a shortcut for <txp:soo_page_count format="{prev}" />
.
Attributes
In addition to soo_page_count
attributes, each of these tags also accepts a text
attribute for setting the link text. The following tags are equivalent:
<txp:soo_next_page text="Next" /> <txp:soo_page_count format="{next}" next="Next" />
Version History
0.4.2 (2020-03-09)
- Fixed longstanding bug that used to be harmless but turned lethal in Txp 4.8.0
0.4.1 (2017-03-10)
- New URI handling algorithm, reverting to version 0.3 behavior, but as a freestanding plugin
0.4.0 (2017-03-04)
- Refactored to eliminate the requirement for an external library plugin. (NB: this means, inter alia, that the
p
(image ID) query parameter is no longer preserved in page links.)
0.3.2 (2017-02-15)
- Textpattern 4.6 compatibility update
0.3.1 (2012-01-27)
soo_page_count
(hence alsosoo_prev_page
andsoo_next_page
) now preserve non-Txp query params for “next” and “prev” links.
0.3.0 (2011-01-18)
- Plugin now includes a Textpack to localize pre-formatted text output such as “Page {current} of {total}”. Currently includes 21 languages.
0.2.7 (2010-02-11)
- Fixed Textpattern notice about non-existent attribute when using
soo_prev_page
orsoo_next_page
(functionality not affected)
0.2.6 (2009-11-23)
soo_page_links
now restores the'pg'
query parameter to its initial state, to avoid conflicts with other context-dependent plugins
0.2.5 (2009-10-21)
- New attributes and shortcut tags for
soo_page_count
0.2.4 (2009-07-16)
- Fixed
showalways
bug when an article list returns 0 pages (e.g. empty category)
0.2.3 (2009-07-09)
- Improved context check to prevent raw tag output
0.2.2 (2009-07-09)
- When both
wraptag
andbreak
are set, non-linked text items (i.e., current page number or placeholder text) are no longer wrapped inspan
tags, andactive_class
is applied to thebreak
element containing the current page number. - Both tags now do a context check and show nothing if the page is not an article list
0.2.1 (2009-07-07)
- Changed file name and one tag name
- The
showalways
attribute ofsoo_page_count
now also affects output when the article list is only one page soo_page_links
has also been given theshowalways
attribute- Scrapped
soo_article_count
, which was inherently buggy (as is thersx_to_of
it was based on)
0.2 (2009-05-22)
Not publicly released. Code overhaul, fixed to work with any query string
0.1 (ages ago)
Not publicly released, not very good either, just a sorry hack of what was probably a quick one-off plugin to begin with (it was early days for Txp).
Posted 2009-07-08 (last modified 2017-03-13)