Jump to content

Help:Custom namespaces

From Wikinews, the free news source you can write!

If you want to add a custom namespace, you need to do the following:

  1. Pick the names of your namespace and it's talk page. Also pick numbers.
Note: Even numbers are for the main namespaces, odds for the talk pages. Custom pages start at 100.
Important: Do not include spaces in the name, use an underscore instead
  1. Goto /includes/DefaultSettings.php and copy the variables $wgExtraNamespaces, $wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefault into LocalSettings.php
  2. Add to $wgExtraNamespaces the name of your namespace and it's talk page, as it would appear in a link.
Example:
$wgExtraNamespaces =
       array(100 => "Foo", 
             101 => "Foo_Talk");
  1. If you want subpages, add it to $wgNamespacesWithSubpages
Example:
$wgNamespacesWithSubpages = 
       array( -1 => 0, 0 => 0, 1 => 1, 2 => 1, 3 => 1,
              4 => 0, 5 => 1, 6 => 0, 7 => 1, 
              8 => 0, 9 => 1, 10 => 0,11 => 1,
              100 => 1, 101 => 1 );
  1. If you want the new namespace (or it's talk page) searched by default, set $wgNamespacesToBeSearchedDefault
Example:
$wgNamespacesToBeSearchedDefault =
       array( -1 => 0, 0 => 1, 1 => 0, 2 => 0, 3 => 0,
               4 => 0, 5 => 0, 6 => 0, 7 => 0,
               8 => 0, 9 => 1, 10 => 0, 11 => 1,
               100 => 1, 101 => 1 );
This is a copy of m:Help:Custom namespaces using Wikinews-specific templates. Don't edit this page, except to replace the contents with the current version of that master page. To make changes applicable on all projects, edit the master page; to change Wikinews-specific content, edit the templates; to make demos work, copy templates to this project, and images to Wikimedia Commons. Please see the history of the master page for author details. Please note that all meta content is licensed under the GFDL. As a result this page is licensed under the GFDL. - Edit this template