Difference between revisions of "Template:Main talk other flex/doc"

From blackwiki
Jump to navigation Jump to search
test>Davidgothberg
(Added "Category:Wikipedia metatemplates".)
test>Davidgothberg
(Made it into a "soft redirect" to the documentation at {{main talk other}}. And added an explanation why it has the full list of namespaces in it.)
Line 4: Line 4:
 
This is the {{tl|main talk other flex}} template.
 
This is the {{tl|main talk other flex}} template.
  
This template detects and returns what namespace group a page belongs to. Depending on what kind of page it is used on it returns one of these three lower case words:
+
It helps other templates detect what kind of page they are on.
:'''main''' = Main/article space, as in normal Wikipedia articles.
 
:'''talk''' = Any talk space, such as page names that start with "Talk:", "User talk:", "Image talk:" and so on.
 
:'''other''' = All other spaces, such as page names that start with "User:", "Image:", "Wikipedia:" and so on.
 
  
This template page (and its doc page) belongs in the namespace group "other". Thus:
+
This template works exactly the same as the {{tl|main talk other}} template, but they have some minor internal differences. Documentation for both these templates are at {{tl|main talk other}}. That documentation also covers their internal differences.
  
<pre>
+
'''Note!''' Do not optimise or cut away any "unnecessary" parts of the code in this template. This code serves as an example to copy and paste from when one wants to modify it to detect different namespace combinations. That's why the code contains a full list of the Wikipedia namespaces.  
{{main talk other flex}}
 
</pre>
 
 
 
Renders like this:
 
 
 
:{{main talk other flex}}
 
 
 
This template can also take three parameters and then returns (uses) one of them depending on which namespace group a page belongs to. Like this:
 
 
 
<pre>
 
{{main talk other flex|Article text|Talk page text|Other pages text}}
 
</pre>
 
 
 
Which renders like this:
 
 
 
:{{main talk other flex|Article text|Talk page text|Other pages text}}
 
 
 
 
 
=== More docs soon ===
 
 
 
The template code itself is ready and tested. But these docs will be extended a lot within some days.
 
 
 
--[[User:Davidgothberg|David Göthberg]] ([[User talk:Davidgothberg|talk]]) 20:28, 15 March 2008 (UTC)
 
 
 
=== Links for this code ===
 
 
 
* [[Wikipedia:Namespace]]
 
* [[Help:Magic words]]
 
* [[meta:Help:ParserFunctions]]
 
* {{tl|pp-meta}}
 
* {{tl|notice}}
 
 
 
=== See also ===
 
 
 
* {{tl|main talk other}} - Another version of this template.
 
  
 
<includeonly>
 
<includeonly>

Revision as of 23:36, 15 March 2008

This is the {{main talk other flex}} template.

It helps other templates detect what kind of page they are on.

This template works exactly the same as the {{main talk other}} template, but they have some minor internal differences. Documentation for both these templates are at {{main talk other}}. That documentation also covers their internal differences.

Note! Do not optimise or cut away any "unnecessary" parts of the code in this template. This code serves as an example to copy and paste from when one wants to modify it to detect different namespace combinations. That's why the code contains a full list of the Wikipedia namespaces.