Extension:UrlGetParameters
|
UrlGetParameters Release status: stable |
|||
|---|---|---|---|
| Implementation | Parser function | ||
| Description | Provides a parserfunction {{#urlget:...}} which allows access to the url parameters in your page.
|
||
| Author(s) | S.O.E. Ansems | ||
| Last version | 1.3.0 (2012-01-19) | ||
| MediaWiki | 1.10.x or higher | ||
| Database changes | no | ||
| License | No license specified | ||
| Download | |||
|
|||
| Check usage and version matrix | |||
This extension enables you to use and/or display the "GET" parameters of the URL, i.e. the query string, on the wiki page.
Contents |
Download [edit]
You can download the code, in .tgz format, here.
You can also download the code directly via Git from the MediaWiki source code repository. From a command line, call the following:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UrlGetParameters.git
To view the code online, including version history for each file, go here.
Installation [edit]
Once you have downloaded the extension, enable it by adding this line to your LocalSettings.php:
require_once( "$IP/extensions/UrlGetParameters/UrlGetParameters.php" );
Usage [edit]
To display the value of a URL get parameter in your page, you might do this:
{{#urlget:parameter-name}}
Where parameter-name is the name of the parameter whose value you want. If the parameter is not found, the extension will result in nothing. Alternatively, you can also specify a default value as follows:
{{#urlget:parameter-name|default-value}}
When the parameter parameter-name is not available, then the value default-value is returned.
If the URL contains parameters of the form "A[B]=C", you can display the value "C" in a similar way, by calling:
{{#urlget:A[B]}}
Authors [edit]
This extension was written by S.O.E. Ansems. Important contributions were made by Ankit Garg and some anonymous editors.
Version history [edit]
| Version | Date | Changes |
|---|---|---|
| 1.0 | February 21, 2008 |
|
| 1.1 | February 15, 2011 |
|
| 1.2 | March 2, 2011 |
|