Changes

Jump to navigation Jump to search
m
1 revision
Line 1: Line 1:  
{{documentation subpage}}
 
{{documentation subpage}}
{{high-risk|3,000,000+}}
+
{{high-risk|3,250,000+}}
 +
{{lua|Module:Namespace detect}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
   −
This is the {{tl|namespace detect}} meta-template.
+
This is the {{tl|namespace detect}} meta-template. It helps other templates detect what type of page they are on.
 
  −
It helps other templates detect what type of page they are on.
      
It detects and groups all the different [[Wikipedia:Namespace#Enumeration|namespaces]] used on Wikipedia into several types:
 
It detects and groups all the different [[Wikipedia:Namespace#Enumeration|namespaces]] used on Wikipedia into several types:
   −
:'''main''' = Main/article space, as in normal Wikipedia articles.
+
:'''main''' = Main/article space, where normal Wikipedia articles are kept.
:'''talk''' = Any talk space, such as page names that start with "Talk:", "User talk:", "File talk:" and so on.
+
:'''talk''' = Any talk space, including page names that start with "Talk:", "User talk:", "File talk:" and so on.
:'''user, wikipedia, file, mediawiki, template, help, category''', '''portal''' and '''book''' = The other namespaces except the talk pages.
+
:'''user, wikipedia, file, mediawiki, template, help, category''', '''portal''' and '''book''' = Other namespaces except the talk pages.
 
:'''other''' = Any namespaces that were not specified as a parameter to the template. See explanation below.
 
:'''other''' = Any namespaces that were not specified as a parameter to the template. See explanation below.
   −
For backwards compatibility this template also understands the old name '''image''' for '''file'''. But using '''image''' is now deprecated.
+
For backwards compatibility this template also understands '''image''' for '''file'''. '''Image''' is now deprecated.
   −
'''Note!''' For most usage cases it might be better to use the simpler namespace detection templates. (See the [[#See also|see also]] section below.) Since this template is more prone to human errors such as misspelling the parameter names.  
+
'''Note:''' For most cases it may be better to use the simpler namespace detection templates (see the [[#See also|see also]] section below). This template is more prone to human errors such as misspelling parameter names.
    
=== Usage ===
 
=== Usage ===
Line 80: Line 79:     
=== Demospace and page ===
 
=== Demospace and page ===
For testing and demonstration purposes this template can take two parameters named '''demospace''' and '''page'''.  
+
For testing and demonstration purposes this template can take two parameters named '''demospace''' and '''page'''.
    
Demospace understands any of the page type names used by this template, including the '''other''' type. It tells the template to behave like it is on some specific type of page. Like this:
 
Demospace understands any of the page type names used by this template, including the '''other''' type. It tells the template to behave like it is on some specific type of page. Like this:
    
<pre>
 
<pre>
{{namespace detect  
+
{{namespace detect
 
| main  = Article text
 
| main  = Article text
 
| other = Other pages text
 
| other = Other pages text
Line 94: Line 93:  
No matter on what kind of page the code above is used it will return this:
 
No matter on what kind of page the code above is used it will return this:
   −
:{{namespace detect  
+
:{{namespace detect
 
| main  = Article text
 
| main  = Article text
 
| other = Other pages text
 
| other = Other pages text
Line 103: Line 102:     
<pre>
 
<pre>
{{namespace detect  
+
{{namespace detect
 
| user  = User page text
 
| user  = User page text
 
| other = Other pages text
 
| other = Other pages text
Line 112: Line 111:  
No matter on what kind of page the code above is used it will return this:
 
No matter on what kind of page the code above is used it will return this:
   −
:{{namespace detect  
+
:{{namespace detect
 
| user  = User page text
 
| user  = User page text
 
| other = Other pages text
 
| other = Other pages text
Line 121: Line 120:     
<pre>
 
<pre>
{{namespace detect  
+
{{namespace detect
 
| main  = Article text
 
| main  = Article text
 
| other = Other pages text
 
| other = Other pages text
Line 139: Line 138:  
...
 
...
 
| other =
 
| other =
| demospace = {{{demospace|}}} / main / talk / user /  
+
| demospace = {{{demospace|}}} / main / talk / user /
               wikipedia / file / mediawiki / template /  
+
               wikipedia / file / mediawiki / template /
 
               help / category / portal / book / other
 
               help / category / portal / book / other
 
| page  = {{{page|}}} / User:Example
 
| page  = {{{page|}}} / User:Example

Navigation menu