Extension:DynamicRedirect
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
DynamicRedirect Release status: unmaintained |
|
---|---|
Implementation | Special page |
Description | Redirects user to a dynamically determined page |
Author(s) | Petr Kadlec (Mormegiltalk) |
MediaWiki | |
License | GNU General Public License 2.0 or later |
Download | GitHub: Note: Readme file |
The DynamicRedirect extension provides redirection to a dynamically determined page. In the current version, the target can be determined either by evaluating a piece of wikitext, or chosen from a category.
Installation
edit- Download and place the file(s) in a directory called
DynamicRedirect
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
require_once "$IP/extensions/DynamicRedirect/DynamicRedirect.php";
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
editBy going to a URL in the form of
.../Special:DynamicRedirect?mode=mode&target=target
the user is redirected to a page chosen based on the values of the parameters:
mode
is the primary mode selector, the currently supported values are:parse
– parse the expression given intarget
and use the resulting text as the page title to redirect tocatfirst
– redirect to the first page in the category which title is intarget
(without the Category: prefix)catlast
– redirect to the last page in the category which title is intarget
(without the Category: prefix)
target
– parameter containing either the wikitext, or the category name
If the parameters are not valid, or there is no target page fulfilling the parameters, Special:DynamicRedirect displays a UI (and possibly an error message) showing the available options.
Transclusion
editA page dynamically determined per the above criteria (e.g. the last page of a category) can also be transcluded on another page using the straightforward syntax
{{Special:DynamicRedirect | mode = mode | target = target}}
with mode
and target
same as above.