Extension:PageAfterAndBefore

Purpose
Provides a 'magic word' interface to retrieve 'preceeding' and 'succeeding' pages relative to a given page title.

This extension may be used for example in a navigation template (showing previous/next links) added on top or bottom of pages that are autocategorized in the same category by their inclusion of the navigation template : it avoids the need to edit the previous/next links in these pages.

This extension may also be useful to enumerate all pages listed in a category, and reporting them with a presentation template, using a  processing loop (see #while in Extension:Loops). But be careful in this case, because the loop may become very long to process in MediaWiki and could generate extremely large report volumes for visitors of the page, if the category is too much populated (the default limit for the Extension:Loops is set to 100, unless it has been configured): such processing loop should include a counter test, and should be generating a visible warning at end of the report indicating that it is not complete and that the enumerated category should be better subcategorized to contain no more than 100 entries (or the maximum configured in that Extension:Loops).

Features
where
 * context  namespace   title   category
 * context  namespace   title   category
 * context  namespace                            category   filtercurrent
 * context  namespace                            category   filtercurrent
 * context      : is reserved for future use
 * namespace    : denotes the canonical name of the namespace one wishes to act on
 * title        : denotes the 'prefixedDBkey' (i.e. title name with underscores)
 * category     : denotes the category name used for filtering titles
 * filtercurrent : allows filtering or not the returned last/first page title, when it maches the current page title:
 * if filtercurrent is set to yes and the the page where the parser function is used also happens to be the last AND/OR first of the set, then it will be filtered OUT (not returned) — this value of yes is only useful if the page using the parser function is correctly sorted with an appropriate key, making it appear the first one or the last one in the specified category);
 * if one wishes to have for return value the title in question anyways, then one must set filtercurrent to no — note that the page using the parser function may not be the first of last page in the category, sue to its sort key or unpredictable position in the category indicated, in that case specify no when calling #firstpage or #lastpage, and test the page names returned by #pagebefore or #pageafter).

Dependencies

 * StubManager extension