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
- Download and place the file(s) in a directory called
DynamicRedirectin 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
By 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:
modeis the primary mode selector, the currently supported values are:parse– parse the expression given intargetand 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
A 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.