Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Bourbon Wiki:Namespace
(section)
Project page
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Programming == {{anchor|Enumeration}} The 28 namespaces in the English Wikipedia are numbered for programming purposes. The prefix for each namespace is generated by a [[m:Help:Variable|variable]], using the [[Help:Magic words#Paths|magic word]] <syntaxhighlight lang=wikitext inline>{{ns}}</syntaxhighlight>, in the form <syntaxhighlight lang=wikitext inline>{{ns:xx}}</syntaxhighlight>, as shown in the table below. {| border="0" cellpadding="4" cellspacing="0" class="wikitable" |- !Namespace variable !Result (namespace name) !Namespace variable !Result (talk namespace name) |- |<syntaxhighlight lang=wikitext inline>{{ns:-2}}</syntaxhighlight> |{{ns:-2}} | | |- |<syntaxhighlight lang=wikitext inline>{{ns:-1}}</syntaxhighlight> |{{ns:-1}} | | |- |<syntaxhighlight lang=wikitext inline>{{ns:0}}</syntaxhighlight> |{{ns:0}} (main namespace, returns empty string) |<syntaxhighlight lang=wikitext inline>{{ns:1}}</syntaxhighlight> |{{ns:1}} |- |<syntaxhighlight lang=wikitext inline>{{ns:2}}</syntaxhighlight> |{{ns:2}} |<syntaxhighlight lang=wikitext inline>{{ns:3}}</syntaxhighlight> |{{ns:3}} |- |<syntaxhighlight lang=wikitext inline>{{ns:4}}</syntaxhighlight> |{{ns:4}} |<syntaxhighlight lang=wikitext inline>{{ns:5}}</syntaxhighlight> |{{ns:5}} |- |<syntaxhighlight lang=wikitext inline>{{ns:6}}</syntaxhighlight> |{{ns:6}} |<syntaxhighlight lang=wikitext inline>{{ns:7}}</syntaxhighlight> |{{ns:7}} |- |<syntaxhighlight lang=wikitext inline>{{ns:8}}</syntaxhighlight> |{{ns:8}} |<syntaxhighlight lang=wikitext inline>{{ns:9}}</syntaxhighlight> |{{ns:9}} |- |<syntaxhighlight lang=wikitext inline>{{ns:10}}</syntaxhighlight> |{{ns:10}} |<syntaxhighlight lang=wikitext inline>{{ns:11}}</syntaxhighlight> |{{ns:11}} |- |<syntaxhighlight lang=wikitext inline>{{ns:12}}</syntaxhighlight> |{{ns:12}} |<syntaxhighlight lang=wikitext inline>{{ns:13}}</syntaxhighlight> |{{ns:13}} |- |<syntaxhighlight lang=wikitext inline>{{ns:14}}</syntaxhighlight> |{{ns:14}} |<syntaxhighlight lang=wikitext inline>{{ns:15}}</syntaxhighlight> |{{ns:15}} |- |<syntaxhighlight lang=wikitext inline>{{ns:100}}</syntaxhighlight> |{{ns:100}} |<syntaxhighlight lang=wikitext inline>{{ns:101}}</syntaxhighlight> |{{ns:101}} |- |<syntaxhighlight lang=wikitext inline>{{ns:118}}</syntaxhighlight> |{{ns:118}} |<syntaxhighlight lang=wikitext inline>{{ns:119}}</syntaxhighlight> |{{ns:119}} |- |<syntaxhighlight lang=wikitext inline>{{ns:710}}</syntaxhighlight> |{{ns:710}} |<syntaxhighlight lang=wikitext inline>{{ns:711}}</syntaxhighlight> |{{ns:711}} |- |<syntaxhighlight lang=wikitext inline>{{ns:828}}</syntaxhighlight> |{{ns:828}} |<syntaxhighlight lang=wikitext inline>{{ns:829}}</syntaxhighlight> |{{ns:829}} |} Alternative variables are available for most namespaces, for example <syntaxhighlight lang=wikitext inline>{{ns:talk}}</syntaxhighlight>, <syntaxhighlight lang=wikitext inline>{{ns:user}}</syntaxhighlight>, and <syntaxhighlight lang=wikitext inline>{{ns:user_talk}}</syntaxhighlight> for <syntaxhighlight lang=wikitext inline>{{ns:1}}</syntaxhighlight>, <syntaxhighlight lang=wikitext inline>{{ns:2}}</syntaxhighlight> and <syntaxhighlight lang=wikitext inline>{{ns:3}}</syntaxhighlight>. The portal namespace is numbered in the 100-plus range, as are all MediaWiki nonstandard namespaces. It is also possible to use {{tl|Namespace name}} for this, i.e. "<syntaxhighlight lang=wikitext inline>{{Namespace name|711}}</syntaxhighlight>" produces "{{Namespace name|711}}". All namespaces with a positive number or zero in this list are searchable. Specifically, the {{ns:-2}} and {{ns:-1}} namespaces are not searchable. The [[Help:Magic words|magic word]] <syntaxhighlight lang=wikitext inline>{{NAMESPACE}}</syntaxhighlight> returns the namespace prefix of the current page. This can be used in combination with other magic words and [[meta:Help:ParserFunctions|parser functions]] to change the appearance of [[WP:Template|templates]] depending on the namespace in which they are transcluded. Meta-templates have been created to simplify this process. These include the simple template {{tl|main other}}, and the more complex and versatile {{tl|namespace detect}}. For information on changing the appearance of a page or template by namespace based on CSS, see '''CSS''' section of [[mw:Help:Namespaces#Identifying namespaces|Identifying namespaces]] on the MediaWiki help page.
Summary:
Please note that all contributions to Bourbon Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Bourbon Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width