Manual:$wgExtraNamespaces

From MediaWiki.org

Jump to: navigation, search
Namespaces: $wgExtraNamespaces
Additional namespaces.
Introduced in version: 1.3.3
Removed in version: still in use
Allowed Values: array
Default Value: NULL

Other settings: Alphabetical | By Function


[edit] Details

$wgExtraNamespaces is used to configure additional, custom namespaces for a wiki.

This is covered in detail on Manual:Using custom namespaces. Note that the first custom namespace should use the ID 100, as IDs from 0 to 99 are reserved (and negative IDs have a special meaning). The maximum namespace ID was 255 on some older (pre-1.5) MediaWiki versions, 16-bit namespace numbers are supported in all current releases.

Note: When you define a namespace or set a name of a namespace to something which contains a space, use an underscore in place of the space. For example, 'My Namespace' is an invalid name and will cause problems. Instead, use 'My_Namespace' in the namespace definition.

[edit] Example

To add a namespace with the name 'Foo' to your wiki you need to create 2 new namespaces (one for the Foo page and one for its associated talk page):

define("NS_FOO", 100);
define("NS_FOO_TALK", 101);
 
$wgExtraNamespaces[NS_FOO] = "Foo";
$wgExtraNamespaces[NS_FOO_TALK] = "Foo_talk";