Difference between revisions of "Help:Namespace"

From ISFDB
Jump to navigation Jump to search
Line 31: Line 31:
  
 
It is possible to customize the visual appearance of pages and the appearance and function of templates based on namespace. See sections [[#Template programming|Template programming]] and [[#CSS based namespace detection|CSS based namespace detection]] below.
 
It is possible to customize the visual appearance of pages and the appearance and function of templates based on namespace. See sections [[#Template programming|Template programming]] and [[#CSS based namespace detection|CSS based namespace detection]] below.
 +
 +
== List of namespaces ==
 +
The two pseudo-namespaces, main namespace and 15 auxiliary namespaces in ''this'' project (Meta) are as follows (the [[help:Variable|variable]]s for them are also shown).
 +
 +
Note that the number of pages in each namespace may not be displayed on all MediaWiki projects, because this counting feature may be disabled): on this Wiki, per-namespace page counting is currently {{PAGESINNS:0}} [[:{{ns:Template}}:PAGESINNS:0]] {{PAGESINNS:0}}  |disabled|available .
 +
 +
{|class="wikitable" style="clear:both"
 +
|-
 +
!Variables
 +
!Alternate syntax
 +
!Name, linked to list of all such pages
 +
!Notes
 +
|-
 +
|<nowiki>{{ns:-2}}</nowiki>
 +
|<nowiki>{{ns:media}}</nowiki>
 +
|&quot;{{ns:-2}}&quot;
 +
|pseudo-namespace for images and other files themselves, as opposed to the image description pages; see also below
 +
|-
 +
|<nowiki>{{ns:-1}}</nowiki>
 +
|<nowiki>{{ns:special}}</nowiki>
 +
|&quot;{{ns:-1}}&quot;
 +
|pseudo-namespace for [[Help:Special page|special page]]s (list: [[Special:Specialpages]])
 +
|-
 +
|<nowiki>{{ns:0}}</nowiki>
 +
|
 +
|[{{fullurl:Special:Allpages|namespace=0}} main]
 +
|main namespace, no prefix, or optionally a colon (this is needed when using the page as template)
 +
|-
 +
|<nowiki>{{ns:1}}</nowiki>
 +
|<nowiki>{{ns:talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=1}} {{ns:1}}]
 +
|see [[:Help:Talk page]] for this and the following odd-numbered namespaces
 +
|-
 +
|<nowiki>{{ns:2}}</nowiki>
 +
|<nowiki>{{ns:user}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=2}} {{ns:2}}]
 +
|registered users (list: [[Special:Listusers]]) have a user homepage User:''username'' (linked to by the system from user names in [[Help:Edit_summary#Places_where_the_edit_summary_appears|lists of edits]], e.g. on [[Help:Page history|page histories]], and from signatures on talk pages); this and [[Help:Link#Subpage_feature|subpages]] of it can be used to present oneself, for project-related bookmarks, and for drafts, tests, and other working material. One can put here material to give oneself one-step access to it from any page in the same project, and one can put here links to give oneself two-step access to the link targets from any page in the same project as the user page. For users who do not log in, the same applies, with the IP as username. Dynamic IPs are a complication.
 +
|-
 +
|<nowiki>{{ns:3}}</nowiki>
 +
|<nowiki>{{ns:user_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=3}} {{ns:3}}]
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:4}}</nowiki>
 +
|<nowiki>{{ns:project}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=4}} {{ns:4}}]
 +
|the project namespace for matters ''about'' the project, such as guidelines and discussions; see also the [[Help:|Help:]] namespace
 +
|-
 +
|<nowiki>{{ns:5}}</nowiki>
 +
|<nowiki>{{ns:project_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=5}} {{ns:5}}]
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:6}}</nowiki>
 +
|<nowiki>{{ns:image}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=6}} {{ns:6}}]
 +
|[[help:images and other uploaded files|images and other uploaded files]], with [[Help:Image description page|image description page]]s (list: [[Special:Imagelist]])
 +
|-
 +
|<nowiki>{{ns:7}}</nowiki>
 +
|<nowiki>{{ns:image_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=7}} {{ns:7}}]
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:8}}</nowiki>
 +
|<nowiki>{{ns:mediawiki}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=8}} {{ns:8}}]
 +
|system messages (list: [[Special:Allmessages]]), editable by users, or if protected, by sysops
 +
|-
 +
|<nowiki>{{ns:9}}</nowiki>
 +
|<nowiki>{{ns:mediawiki_talk}}</nowiki>
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:10}}</nowiki>
 +
|<nowiki>{{ns:template}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=10}} {{ns:10}}]
 +
|the default namespace for [[help:template|template]]s: the wikitext code <nowiki>{{</nowiki>''name'' }} refers to and includes the page Template:''name''
 +
|-
 +
|<nowiki>{{ns:11}}</nowiki>
 +
|<nowiki>{{ns:template_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=11}} {{ns:11}}]
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:12}}</nowiki>
 +
|<nowiki>{{ns:help}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=12}} {{ns:12}}]
 +
|typically used for the MediaWiki User's Guide, with the wikitext a frequently refreshed copy of the master version on Meta-Wikipedia, but with project-specific templates
 +
|-
 +
|<nowiki>{{ns:13}}</nowiki>
 +
|<nowiki>{{ns:help_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=13}} {{ns:13}}]
 +
|&nbsp;
 +
|-
 +
|<nowiki>{{ns:14}}</nowiki>
 +
|<nowiki>{{ns:category}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=14}} {{ns:14}}]
 +
|each page (list: [[Special:Categories]]) represents a [[Help:Category|category]] of pages, with each category page displaying a list of pages in that category and optional additional text.
 +
|-
 +
|<nowiki>{{ns:15}}</nowiki>
 +
|<nowiki>{{ns:category_talk}}</nowiki>
 +
|[{{fullurl:Special:Allpages|namespace=15}} {{ns:15}}]
 +
|&nbsp;
 +
|}
 +
 +
Note that all characters of namespace prefixes are case-insensitive, so one can write, for example, "mediawiki". Also, underscores in namespace prefixes are equivalent to any non-zero number of spaces (leading or trailing spaces or underscores are ignored) : underscores are used only when encoding URLs but treated otherwise like spaces.
 +
 +
These names are set in the MessagesXX.php language files. The English defaults are below:
 +
<pre>/* private */ $namespaceNames = array(
 +
NS_MEDIA            => 'Media',
 +
NS_SPECIAL          => 'Special',
 +
NS_MAIN             => '',
 +
NS_TALK             => 'Talk',
 +
NS_USER            => 'User',
 +
NS_USER_TALK        => 'User_talk',
 +
NS_WIKIPEDIA        => $wgMetaNamespace,
 +
NS_WIKIPEDIA_TALK  => $wgMetaNamespace . '_talk',
 +
NS_IMAGE            => 'Image',
 +
NS_IMAGE_TALK      => 'Image_talk',
 +
NS_MEDIAWIKI        => 'MediaWiki',
 +
NS_MEDIAWIKI_TALK  => 'MediaWiki_talk',
 +
NS_TEMPLATE        => 'Template',
 +
NS_TEMPLATE_TALK    => 'Template_talk',
 +
NS_HELP            => 'Help',
 +
NS_HELP_TALK        => 'Help_talk',
 +
NS_CATEGORY     => 'Category',
 +
NS_CATEGORY_TALK    => 'Category_talk'
 +
);</pre>
 +
  
  

Revision as of 18:02, 13 November 2008

Page titles in MediaWiki are composed of two parts: an optional namespace name, and the remainder of the title. For example, this page has the title [[Help:Namespace]], so it is in the Help namespace. A title without a colon, for example [[Goings-on]], is in the main namespace.

By default, a wiki using the MediaWiki software has 18 namespaces, including:

  • the main namespace, where page names have no prefix
  • 15 additional namespaces, each with its own prefix. (Two namespaces, the so-called 'project' namespaces, get their names from the name of the wiki project, and so differ in name from one wiki to the next; on the ISFDB, they are called ISFDB: and ISFDB talk:. On each wiki, these project namespaces (whatever they may happen to be for that wiki), can be referred to by the pseudonyms "Project:" and "Project Talk:", respectively.)
  • two pseudo-namespaces

But take note:

  • If a page title contains a colon, but the initial part of the title is not one of the pre-defined namespaces, that page is considered to be in the main namespace.

Namespace uses

Namespaces allow, among other things, a separation of content from policy and discussion. They encourage separation of the pages of a wiki into a core set intended for public viewing, and private information intended for the editing community.

The core set is the main namespace. Other namespaces that are also useful to viewers are:

  • the image namespace (with the full-size images)
  • the category namespace (for navigation)
  • the help pages and the preferences page (as far as they concern viewing)

By default, searches and the random page feature are restricted to the main namespace, thus the user interface is directed towards readers who are not part of the community.

User contributions can show all or be restricted to a namespace of choice.

The subpage feature can be enabled for selected namespaces.

It is possible to customize the visual appearance of pages and the appearance and function of templates based on namespace. See sections Template programming and CSS based namespace detection below.

List of namespaces

The two pseudo-namespaces, main namespace and 15 auxiliary namespaces in this project (Meta) are as follows (the variables for them are also shown).

Note that the number of pages in each namespace may not be displayed on all MediaWiki projects, because this counting feature may be disabled): on this Wiki, per-namespace page counting is currently Template:PAGESINNS:0 Template:PAGESINNS:0 Template:PAGESINNS:0 |disabled|available .

Variables Alternate syntax Name, linked to list of all such pages Notes
{{ns:-2}} {{ns:media}} "Media" pseudo-namespace for images and other files themselves, as opposed to the image description pages; see also below
{{ns:-1}} {{ns:special}} "Special" pseudo-namespace for special pages (list: Special:Specialpages)
{{ns:0}} main main namespace, no prefix, or optionally a colon (this is needed when using the page as template)
{{ns:1}} {{ns:talk}} Talk see Help:Talk page for this and the following odd-numbered namespaces
{{ns:2}} {{ns:user}} User registered users (list: Special:Listusers) have a user homepage User:username (linked to by the system from user names in lists of edits, e.g. on page histories, and from signatures on talk pages); this and subpages of it can be used to present oneself, for project-related bookmarks, and for drafts, tests, and other working material. One can put here material to give oneself one-step access to it from any page in the same project, and one can put here links to give oneself two-step access to the link targets from any page in the same project as the user page. For users who do not log in, the same applies, with the IP as username. Dynamic IPs are a complication.
{{ns:3}} {{ns:user_talk}} User talk  
{{ns:4}} {{ns:project}} ISFDB the project namespace for matters about the project, such as guidelines and discussions; see also the [[Help:|Help:]] namespace
{{ns:5}} {{ns:project_talk}} ISFDB talk  
{{ns:6}} {{ns:image}} File images and other uploaded files, with image description pages (list: Special:Imagelist)
{{ns:7}} {{ns:image_talk}} File talk  
{{ns:8}} {{ns:mediawiki}} MediaWiki system messages (list: Special:Allmessages), editable by users, or if protected, by sysops
{{ns:9}} {{ns:mediawiki_talk}}  
{{ns:10}} {{ns:template}} Template the default namespace for templates: the wikitext code {{name }} refers to and includes the page Template:name
{{ns:11}} {{ns:template_talk}} Template talk  
{{ns:12}} {{ns:help}} Help typically used for the MediaWiki User's Guide, with the wikitext a frequently refreshed copy of the master version on Meta-Wikipedia, but with project-specific templates
{{ns:13}} {{ns:help_talk}} Help talk  
{{ns:14}} {{ns:category}} Category each page (list: Special:Categories) represents a category of pages, with each category page displaying a list of pages in that category and optional additional text.
{{ns:15}} {{ns:category_talk}} Category talk  

Note that all characters of namespace prefixes are case-insensitive, so one can write, for example, "mediawiki". Also, underscores in namespace prefixes are equivalent to any non-zero number of spaces (leading or trailing spaces or underscores are ignored) : underscores are used only when encoding URLs but treated otherwise like spaces.

These names are set in the MessagesXX.php language files. The English defaults are below:

/* private */ $namespaceNames = array(
	NS_MEDIA            => 'Media',
	NS_SPECIAL          => 'Special',
	NS_MAIN	            => '',
	NS_TALK	            => 'Talk',
	NS_USER             => 'User',
	NS_USER_TALK        => 'User_talk',
	NS_WIKIPEDIA        => $wgMetaNamespace,
	NS_WIKIPEDIA_TALK   => $wgMetaNamespace . '_talk',
	NS_IMAGE            => 'Image',
	NS_IMAGE_TALK       => 'Image_talk',
	NS_MEDIAWIKI        => 'MediaWiki',
	NS_MEDIAWIKI_TALK   => 'MediaWiki_talk',
	NS_TEMPLATE         => 'Template',
	NS_TEMPLATE_TALK    => 'Template_talk',
	NS_HELP             => 'Help',
	NS_HELP_TALK        => 'Help_talk',
	NS_CATEGORY	    => 'Category',
	NS_CATEGORY_TALK    => 'Category_talk'
);


This page is derived from the MediaWiki help page on Namespace

[[Category:Wiki Help|Namespace}}