Extension:UrlGetParameters

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
UrlGetParameters
Release status: stableCategory:Stable extensions
Implementation Parser function Category:Parser function extensions
Description Provides a parser function {{#urlget:...}} which allows access to the URL parameters in your page.
Author(s) S.O.E. Ansems
Latest version 1.6.0 (2021-04-16)
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
Database changes No
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
  • $wgUrlGetParametersSeparator
Quarterly downloads 10 (Ranked 106th)
Translate the UrlGetParameters extension if it is available at translatewiki.net
Vagrant role urlgetparameters
Category:All extensions

The UrlGetParameters extension enables you to use and/or display the "GET" parameters of the URL, i.e. the query string, on the wiki page.

Installation

  • Download and move the extracted UrlGetParameters folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UrlGetParameters
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'UrlGetParameters' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

Caching for the page you use this extension on should be disabled.

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

This extension was written by S.O.E. Ansems. Important contributions were made by Ankit Garg and some anonymous editors.

Category:All extensions Category:Extensions in Wikimedia version control Category:Extensions included in BlueSpice Category:Extensions included in Canasta Category:Extensions included in Miraheze Category:Extensions included in Open CSP Category:Extensions included in WikiForge Category:Extensions included in semantic::core Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:ParserFirstCallInit extensions Category:Parser function extensions Category:Stable extensions