User:Brion.finlay/PathFunctions

This extension provides custom variables that allow specifying the page to use when evaluating page specific MediaWiki variables for page names, namespaces, and latest revisions (for example, ), , and.

Example
gives Foo gives Help gives the latest revision id for Help:Foo

Uses

 * When transcluding one article into another, this allows you to display information about the transcluded page.
 * When building templates, this allows you to extract portions of an article name passed in as a parameter.

Latest revision to a page
The following variables return data about the latest edit to the current page, even if viewing an older version of the page.

Page names
The following are URL-encoded equivalents:

Namespaces
The following are URL-encoded equivalents:

Configuration
Setting the variable $wgPathFunctionsUseNoPrefixHash to true allows the variables to be used without the preceeding hash symbol, and so appear more like the built in variables. For example.

Installation
Add this line to LocalSettings.php: require_once( "$IP/extensions/PathFunctions/PathFunctions.php" );

And copy the following to extensions/PathFunctions/PathFunctions.php and extensions/PathFunctions/PathFunctions.i18n.php: