soo_page_numbers Page 1 of 2 »
soo_page_numbers
Summary:
Article list navigation and page count widgets
Download
soo_page_numbers version 0.2.7 (3.5 KB)soo_txp_obj version 1.0.b.8 (31.9 KB)
Overview
Display page navigation widgets and information for article list pages. A rehash of the rsx_page_number plugin, bringing it into the modern (Txp 4.0.8 +) era with more attributes for greater control, and also correct function with multiple query string parameters (as with search results, messy URL mode, or other Txp plugins that add their own query params).
As downloaded it requires PHP5 and the soo_txp_obj library plugin. But it only uses a small part of the library, so if you are comfortable editing code you can copy in the relevant code to avoid the extra plugin, if you don’t need soo_txp_obj for something else. Delete the require_plugin('soo_txp_obj') line, and paste in the following two classes from soo_txp_obj: soo_obj (at the top of soo_txp_obj) and soo_uri (at the bottom). If you are running the MLP Pack you might also want to copy in the 15 or so lines above soo_uri, starting with global $plugin_callback;.
Note on using with multiple article tags: If you have more than one article tag on the page (not including article_custom tags, or lists of sticky articles) soo_page_numbers will take its values from the first article 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 (thebreaktag, 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. Ifwraptagandbreakare set,breakis 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 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.2.7 (2010/2/11)
- Fixed Textpattern notice about non-existent attribute when using
soo_prev_pageorsoo_next_page(functionality not affected)
0.2.6 (2009/11/23)
soo_page_linksnow 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
showalwaysbug 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
wraptagandbreakare set, non-linked text items (i.e., current page number or placeholder text) are no longer wrapped inspantags, andactive_classis applied to thebreakelement 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
showalwaysattribute ofsoo_page_countnow also affects output when the article list is only one page soo_page_linkshas also been given theshowalwaysattribute- Scrapped
soo_article_count, which was inherently buggy (as is thersx_to_ofit 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).
- soo_page_numbers
- Next








