Extension:NonincludableNamespaces
From MediaWiki.org
|
NonincludableNamespaces Release status: stable |
|
|---|---|
| Description | Emulates $wgNonincludableNamespaces for older versions of MediaWiki. |
| Author(s) | Mark Clements (HappyDog Talk) |
| Download | Source is available at my test wiki |
This extension is designed to emulate and extend the function of the $wgNonincludableNamespaces configuration variable, which was introduced in MediaWiki v1.10.0.
- In versions of MW < 1.10.0, it emulates the functionality of the config variable, along with the additional functionality detailed below.
- In versions of MW >= 1.10.0, there is already code to handle this variable correctly, but the extension adds a couple of configuration short-cuts that make things a bit more flexible.
Contents |
[edit] Usage
This extension adds the full functionality of $wgNonincludableNamespaces, plus the enhancements below, to versions of MediaWiki < 1.10.0. From 1.10.0 upwards, $wgNonincludableNamespaces exists natively in the software, in which case the extension simply implements the additional features.
[edit] Emulated features
- If
$wgNonincludableNamespacesis not set, then all transclusion is allowed. - If
$wgNonincludableNamespacesis an array then transclusion is not allowed for any namespaces included in the array. Elements must be numeric namespace ids.
[edit] Additional features
- If
$wgNonincludableNamespacesis not an array then it is evaluated as a boolean with the following results:- If
Truethen no transclusion is allowed, except from the template namespace. - If
Falsethen no transclusion is allowed at all.
- If
[edit] Developers
The extension defines the constant NIN_Installed when it is loaded, so extension developers can check whether the $wgNonincludableNamespaces variable is supported, either via MW or this extension, by using the following code:
if ( version_compare($wgVersion, '1.10.0', '>=') || NIN_Installed ) { // Installed }
[edit] Source
Available on my test wiki.

