Extension:NamespaceManager

The NamespaceManager extension allows the creation and modification of namespaces directly from the wiki, using a special page called Special:ManageNamespaces. The namespace definition is in JSON format and stored on the filesystem of your MediaWiki installation. This allows for namespaces to be defined without needing to define them on LocalSettings.php using. Eventually, the special page will allow for simpler management of namespaces using a form rather than editing the raw JSON file.

There was an "extension" with this same name (actually, it was a helper library) many years ago, but it has not been maintained for many years and has been archived. Therefore, this extension now uses this name.

Installation
Be sure that the place where your JSON files are stored is writeable by the web server. If you are using default settings, the directory will be  where   is. On Unix and Apache 2 on a Debian distro, writeability can be achieved by running the following command from your MediaWiki installation's base directory:.

Configuration parameters

 * $wgNamespaceManagerDataPath: The location where your NamespaceManager JSON definition files are stored. (It was called $wgNamespaceManagerDir before 0.3.0, but was renamed in 0.3.0 for sake of correct nomenclature.) By default, it is defined as . You can change this to be either an absolute path anywhere on your filesystem or a relative path rooted in the NamespaceManager base directory and use   in the path, where   is the value of   of your wiki.

Defining namespaces
Namespaces should be defined in JSON format. It can be defined either using Special:ManageNamespaces or manually by editing the  JSON file.

See for an example of how to define a   file.

For instance, you can create a file in the following format:

[   {        "id": 3000, "name": "Property", "content": true, "searchdefault": true, "talksearchdefault": false, "subpages": false, "talksubpages": true, "includable": true, "talkincludable": false, "aliases": ["Properties"], "talkaliases": ["Properties talk"], "editpermissions": [], "talkeditpermissions": ["propertymanagers"] },   {        "id": 3002, "name": "Human Resources", "talkname": "Human Resources discussion", "content": false, "searchdefault": true, "talksearchdefault": false, "subpages": true, "talksubpages": true, "includable": true, "talkincludable": false, "aliases": ["HR"], "talkaliases": ["Human Resources discussion", "HR discussion"], "editpermissions": ["hrstaff"], "talkeditpermissions": ["hrmanagers"] } ]

This would create four namespaces: Property, Property talk, Human Resources, and Human Resources talk, with IDs 3000, 3001, 3002, and 3003 respectively.

All custom namespaces defined in the JSON file must be custom namespaces; otherwise, the extension will fail.

As always with managing custom namespaces, it's a bad idea to remove namespaces if you already have pages under that namespace. If you insist on removing that namespace, all pages should be cleared from under that namespace.

To-do list

 * Add a special page to manage the JSON file
 * Add support for other extensions to integrate to use NamespaceManager

Questions about the direction of the extension

 * Should talk namespaces be represented by an entirely different object? No
 * Should we let people arbitrarily pick the namespace ID if they don't want to start at 3000 and increment up methodically? Yes - as of 0.3.0
 * Should this extension also provide an option to manage the default namespaces' options?
 * What should the special page look like?