Extension:NonincludableNamespaces

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
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 $wgNonincludableNamespaces is not set, then all transclusion is allowed.
  • If $wgNonincludableNamespaces is an array then transclusion is not allowed for any namespaces included in the array. Elements must be numeric namespace ids.

[edit] Additional features

  • If $wgNonincludableNamespaces is not an array then it is evaluated as a boolean with the following results:
    • If True then no transclusion is allowed, except from the template namespace.
    • If False then no transclusion is allowed at all.

[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.

Personal tools