green
 

Help:Namespace

From the G.Knowledge wiki

Template:Hh Template:Handbook sidebar A namespace is a type of page in a wiki project. Page names with prefixes are probably associated with a category. Each wiki using the MediaWiki software has 16+2 namespaces: the main namespace, where page names have no prefix, 15 auxiliary types, each with its own prefix, and two pseudo-namespaces.

In each project they are similar to the 18 explained in w:Wikipedia:Namespace for Wikipedia. One of these is the project namespace, which uses as prefix the project prefix (variable {{ns:4}} below).


Contents

[edit] Namespace uses

  • allows separation of different kinds of unrelated content;
  • several namespaces have special features related to their intended purpose
  • allows unrelated content to be stored in one wiki, but requires lots of extra typing
  • provides facilities to limit searches to a particular area
  • in principal allows easy exporting (but not with the Export feature, which is for selected individual pages) of a selection of work (categories could also be used for this more cleanly)
  • allows for feature separation

[edit] Namespace issues and ideas for improvements

Lots of programming languages have namespaces for their variables. Namespaces are commonly contained within curly braces "{}" and if a variable is referenced that is not included in the namespace, it might use the global namespace's variable.

Extensive content within a namespace causes lots of [[namespace:page name|page name]] in place of [[page name]] typing, which isn't in the spirit of wikis. Nevertheless, it could be useful if the default would be to have the current namespace be searched first, and then the main namespace, or any other order of namespaces consulted.

Namespaces are used for a variety of features, including: interwiki linking, templates, and system messages. How are interwiki and namespace overlap issues dealt with?

[edit] Namespace benefits

(can namespaces go into their own tables, allowing for separation across servers?)

[edit] List of namespaces

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

Variables Alternate syntax Name 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)
- "" 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" logged-in users (list: Special:Listusers) have a user homepage User:username (linked to by the system from lines about edits, 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}} "G. Knowledge" the project namespace for matters about the project, such as guidelines and discussions; see also the Help namespace
{{ns:5}} {{ns:Project_talk}} "G. Knowledge 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}} "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 e.g "mediawiki".

The names are set in files such as those listed in m:Locales for the Wikimedia projects, with default m:Language.php:

/* private */ $wgNamespaceNamesEn = 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'
);

[edit] Automatic conversions of page names

On the left in the table at the beginning of the previous section, a list of project-independent namespace names is shown, the same as those on Meta and the English Wikipedia, except that "Meta" and "Wikipedia" are replaced by "Project". The prefixes are the terms listed, followed by a colon.

The prefix "Project:" is for every project automatically converted to the project namespace, e.g. try the link Project:xyz. It is like a piped link. Therefore a page name starting with "Project:" is not possible (unless, of course, that is the name of the project).

Similarly the other project-independent namespace prefixes are also automatically converted to the project-specific ones.

[edit] Prefixes in various languages

For Wikimedia projects this project prefix is "Wikipedia:", "Wiktionary:", "Wikibooks:", "Wikisource:", "Wikiquote:", "Meta:", and in the case of In Memoriam also "Wikipedia:" (in French "Wikipédia:", in Czech "Wikipedie:", in Russian "Википеди�?:", in Korean "위키백과:", in Hindi "विकिपीडिया:", in Hebrew ":ויקיפדיה" and in Arabic ":ويكيبيديا"). The last two are RTL languages which put the prefixes on the right. In URLs the prefixes are always on the left.

To check which prefix is used, see e.g. the link "Contact us" or "Bug reports". "Talk", "User", "Image" and combinations can also be translated in the case of non-English wikis. see m:Locales for the Wikipedia Software.

[edit] Lists of pages

Oddly, for ordinary users there is no way to list all pages in the project, template, help and custom namespaces. A workaround would be to avoid these and use the main or another namespace, possibly using a non-system prefix, e.g. h:namespace instead of help:namespace.

See e.g. http://gknowledge.wikia.com/index.php?title=Special:Allpages&from=H

Sysops can apply Special:Asksql when not disabled and use "SELECT cur_title FROM cur WHERE cur_namespace=10", etc. When disabled a form invites to submit a query, but then this leads to a HTTP 500 error.

[edit] Colon in page name

Adding a colon to a page name does not automatically create a new namespace. To see the namespace of a page, use {{NAMESPACE}} which returns the namespace. For this page it returns "Help". The same code would return an empty string for a page in the main namespace. Similarly, {{PAGENAME}} returns the page name without prefix. For this page it returns "Namespace".

To take some examples from Wiktionary: Wiktionary:FAQ has Talk page Wiktionary talk:FAQ, but Wiktionary Appendix:Colours has Talk page Talk:Wiktionary Appendix:Colours, because the first is in the project preface namespace and the second is not. Accordingly the first is not in Special:Allpages but the second is. Unclear is why Wiktionary:Recentchanges is an exception.

[edit] Sites outside Wikimedia

Sites using MediaWiki but outside Wikimedia usually have their own project name as project prefix, but several have simply retained "Wikipedia:".

Interwiki linking is done with a prefix, that is similar to namespaces.

[edit] Special namespace

Main article: Help:Special page

The namespace "Special:" consists of "special pages", which are created by the software on demand, for example Special:Recentchanges.

[edit] Custom namespaces

A project can have additional namespaces. For example, if a single project is multilingual (as opposed to the case of sister projects, each in one language) there may be a namespace Help: and also a namespace Hilfe:, for help pages in the English and German language, respectively.

For a full list of all namespaces for your project, see the search options of the preferences (Special:Preferences).

The list of custom namespaces is $wgExtraNamespaces in LocalSettings.php. Custom namespaces are numbered from 100. See also Help:Custom namespaces.

[edit] Tab labels

The first tab shows the namespace. See the link, if it is there, to see what it is in this project. For Meta-Wikipedia it is as shown on the right.

  • category: mediawiki:nstab-category => "Category"
  • help: 'nstab-help' => "Help",
  • image: 'nstab-image' => "Image",
  • main: 'nstab-main' => "content page",
  • media: 'nstab-media' => "Media",
  • mediawiki: 'nstab-mediawiki' => "Message",
  • project: 'nstab-wp' => "About",
  • special: 'nstab-special' => "Special" - the tab is in an HTML element A without class or id, like an internal link, but it is not a link; to see the distinction, use a style for a:link and a:visited that is different from the style of just "a"
  • template: 'nstab-template' => "Template",
  • user: 'nstab-user' => "User page",

The second tab, linking to the talk page:

  • Talk: 'talk' => "Discussion"

On a diff page or a page with an old version, the links are to the current version (however, the edit tab on a page with an old version links to the edit page of that old version; this does not apply on a diff page comparing two old versions, there the edit tab links to the edit page for the current version).

The self link feature (a self link appearing as bold text) does not work for the tabs, no distinction is shown between a self link and a link to a different (version of a) page.

With the class "selected" one can let the tab for the same namespace as the current page (either a self link or a link to the current revison) be displayed differently; also the tabs "edit" and "history" are then displayed in this different way when applicable.

[edit] See also

Template:Hc

Contents

A namespace is a way of separating types of content in a wiki; groups of pages with similar purposes can be grouped together, and can be searched and listed separately from each other. Each page belongs to exactly one namespace.

The namespace of a page is indicated the by the word preceding the colon in the page title. For example, "User talk:Pagename" is a page in the "User talk" namespace. If there is no prefix (or the prefix does not match an existing namespace) the page belongs to the "Main" namespace of that Wikia.

Up to three custom namespaces can be created for Wikia projects if the standard ones do not meet their needs.

Namespaces are used for the following reasons:

  • allows separation of wiki content from help and policy pages about the creation of content;
  • allows separation of different kinds of unrelated content;
  • several namespaces have special features related to their intended purpose
  • provides facilities to limit searches to a particular area
  • allows easy exporting
  • allows for feature separation

What namespaces do all wikis have?

By default, every Wikia has 18 namespaces, and 2 special namespaces. Custom namespaces can also be created.

{{ns:Media}} Media
{{ns:Special}} Special
{{ns:0}} Main namespace for articles
{{ns:1}} Talk (discussion pages for regular Wikia articles)
{{ns:2}} User
{{ns:3}} User talk
{{ns:4}} Wikia Help
{{ns:5}} Wikia Help talk
{{ns:6}} File
{{ns:7}} File talk
{{ns:8}} MediaWiki
{{ns:9}} MediaWiki talk
{{ns:10}} Template
{{ns:11}} Template talk
{{ns:12}} Help
{{ns:13}} Help talk
{{ns:14}} Category
{{ns:15}} Category talk
{{ns:110}} Forum See Help:Wiki-style forums
{{ns:111}} Forum talk

Namespaces added by default extensions

{{ns:400}} Video See Help:Video Embed Tool
{{ns:401}} Video talk
{{ns:500}} User_blog See Help:Blog article
{{ns:501}} User_blog_comments
{{ns:502}} Blog
{{ns:503}} Blog_talk

What are the basic namespaces?

The Main namespace or article namespace (i.e., ns:0) is the informational content of the wiki. In Wikipedia, this would be the encyclopedia article. It is the default namespace and does not use a prefix.

The Project namespace has the prefix of the title of your Wikia (the same title displayed in the {{SITENAME}} variable). On some wikis, this is used to give information about the project's policies and guidelines; other wikis use it for other purposes, or don't use it at all. You can use the prefix "Project:" if you do not know the real prefix to use. This will be converted automatically. For example, Wikia Help:Administrators will link to the same page that Project:Administrators does.

The User namespace has the prefix User: and is used for information about users of the wiki. A user has a main user page and possibly some subpages. The main user page is linked from page histories and from recent changes. A user page has links to a user's contributions and a link which allows you to email them.

The File namespace is prefixed with File:. Pages here are also called image description pages. This namespace is for information about images or other files. Every image uploaded will show the information given in the upload summary on the image description page. (note: Image: will continue to work)

The MediaWiki namespace (prefix MediaWiki:) is a namespace containing interface texts such as link labels and messages. These are only editable by admins. An automatically generated list of all interface messages is at Special:Allmessages. See Help:MediaWiki namespace.

The Template namespace can be used for small standard texts which need to be inserted on a number of pages; see Help:Templates.

The Category namespace contains categories of pages, with each displaying a list of pages in that category and optional additional text; see Help:Category.

The Help namespace is for help pages on wikis which want to separate these from the main content of the wiki.

The Forum namespace can be used for threaded forum messages; see Help:Forums

What are the talk namespaces?

Except for special pages, each namespace has an associated talk namespace. The talk namespaces are designated by adding talk: to the normal prefix. For example, the talk namespace associated with the main article namespace has the prefix Talk:, while the talk namespace associated with the user namespace has the prefix User talk:. Most of the pages in the talk namespaces are used to discuss changes to the corresponding page in the associated namespace. Pages in the user talk namespace are used to leave messages for a particular user since they will get automatic notification of any messages left there; see Help:User page.

What are virtual namespaces?

There are two virtual namespaces that do not relate to pages stored in the database.

Special pages, or the special namespace, are automatically generated and uneditable pages, such as Special:Recentchanges or Special:Userlogin. They're vital to the MediaWiki software.

The Media namespace can be used to link directly to an image or sound clip, in the form [[Media:Image.jpg]] or [[Media:Sound.ogg]], rather than linking to the image description page.

See also