<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://petitplanet.wiki/Template:Namespace/doc?action=history&amp;feed=atom</id>
	<title>Template:Namespace/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://petitplanet.wiki/Template:Namespace/doc?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://petitplanet.wiki/Template:Namespace/doc?action=history"/>
	<updated>2026-10-27T21:37:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://petitplanet.wiki/index.php?title=Template:Namespace/doc&amp;diff=22686&amp;oldid=prev</id>
		<title>ReisuDesign: Created page with &quot;{{Documentation/Header}} {{High Risk}} {{Lua|Namespace detect}}  The {{T|Namespace}} meta-template selectively displays content inside the relevant namespace based on the provided parameters. See Help:Namespace for a list of namespaces and their descriptions.  ==Parameters== * &lt;code&gt;main&lt;/code&gt;: content in this parameter will only be displayed if this template is used on a page in the &#039;&#039;&#039;Main&#039;&#039;&#039; (i.e. article) space. *...&quot;</title>
		<link rel="alternate" type="text/html" href="https://petitplanet.wiki/index.php?title=Template:Namespace/doc&amp;diff=22686&amp;oldid=prev"/>
		<updated>2026-09-02T11:38:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Documentation/Header}} {{High Risk}} {{Lua|Namespace detect}}  The {{T|Namespace}} meta-template selectively displays content inside the relevant namespace based on the provided parameters. See &lt;a href=&quot;/W:Help:Namespace?action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;W:Help:Namespace (page does not exist)&quot;&gt;Help:Namespace&lt;/a&gt; for a list of namespaces and their descriptions.  ==Parameters== * &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Main&amp;#039;&amp;#039;&amp;#039; (i.e. article) space. *...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation/Header}}&lt;br /&gt;
{{High Risk}}&lt;br /&gt;
{{Lua|Namespace detect}}&lt;br /&gt;
&lt;br /&gt;
The {{T|Namespace}} meta-template selectively displays content inside the relevant namespace based on the provided parameters. See [[w:Help:Namespace#What_are_the_basic_namespaces?|Help:Namespace]] for a list of namespaces and their descriptions.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
* &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Main&amp;#039;&amp;#039;&amp;#039; (i.e. article) space.&lt;br /&gt;
* &amp;lt;code&amp;gt;talk&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Talk&amp;#039;&amp;#039;&amp;#039; space, including page names that start with &amp;quot;Talk:&amp;quot;, &amp;quot;User talk:&amp;quot;, &amp;quot;File talk:&amp;quot;, etc.&lt;br /&gt;
* &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;User&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
* &amp;lt;code&amp;gt;file&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
** For backwards compatibility, this template handles &amp;#039;&amp;#039;&amp;#039;image&amp;#039;&amp;#039;&amp;#039; as if &amp;#039;&amp;#039;&amp;#039;file&amp;#039;&amp;#039;&amp;#039;. &amp;#039;&amp;#039;&amp;#039;image&amp;#039;&amp;#039;&amp;#039; (&amp;lt;nowiki&amp;gt;[[Image:...]]&amp;lt;/nowiki&amp;gt;) is now deprecated.&lt;br /&gt;
* &amp;lt;code&amp;gt;mediawiki&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Mediawiki&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
* &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Template&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
* &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Help&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
* &amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Category&amp;#039;&amp;#039;&amp;#039; space&lt;br /&gt;
* &amp;lt;code&amp;gt;project&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page in the &amp;#039;&amp;#039;&amp;#039;Project&amp;#039;&amp;#039;&amp;#039; space (displayed as &amp;#039;&amp;#039;&amp;#039;Genshin Impact Wiki&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
; Special Parameters&lt;br /&gt;
* &amp;lt;code&amp;gt;other&amp;lt;/code&amp;gt;: content in this parameter will only be displayed if this template is used on a page whose namespace does not match any of the other explicitly provided parameters to this template&lt;br /&gt;
* &amp;lt;code&amp;gt;demospace&amp;lt;/code&amp;gt;: Optionally specify the name of a namespace to make the template consider itself to be in that namespace rather than the actual namespace of the page.&lt;br /&gt;
* &amp;lt;code&amp;gt;page&amp;lt;/code&amp;gt;: Optionally specify the name of a page to make the template consider itself to be used on that page rather than the actual page&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
; Example 1&lt;br /&gt;
This template takes one or more parameters named after the different page types as listed above. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = Article text&lt;br /&gt;
|talk  = Talk page text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the template is on a main (article) page, it will return this:&lt;br /&gt;
{{Namespace&lt;br /&gt;
|demospace=main&lt;br /&gt;
|main  = Article text&lt;br /&gt;
|talk  = Talk page text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If the template is on any other page than an article or a talk page, it will return this:&lt;br /&gt;
{{Namespace&lt;br /&gt;
| main  = Article text&lt;br /&gt;
| talk  = Talk page text&lt;br /&gt;
| other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; Example 2&lt;br /&gt;
&lt;br /&gt;
The example above made the template return something for all page types. But if we don&amp;#039;t use the &amp;#039;&amp;#039;&amp;#039;other&amp;#039;&amp;#039;&amp;#039; parameter or leave it empty, it will not return anything for the other page types. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|file     = File page text&lt;br /&gt;
|category = Category page text&lt;br /&gt;
|other    =&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On any pages other than file and category pages the code above will render nothing.&lt;br /&gt;
&amp;lt;!-- Do not remove this one. It is supposed to render nothing, but we have it here for testing purposes. --&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|file     = File page text&lt;br /&gt;
|category = Category page text&lt;br /&gt;
|other    =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; Example 3&lt;br /&gt;
&lt;br /&gt;
By using an empty parameter, you can make it so the template doesn&amp;#039;t render anything for some specific page type. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = &lt;br /&gt;
|other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above will render nothing when on mainspace (article) pages, but will return this when on other pages:&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = &lt;br /&gt;
|other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Demospace and page===&lt;br /&gt;
For testing and demonstration purposes, this template can take two parameters named &amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;page&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
; Example 1&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039; understands any of the page type names used by this template, including the &amp;#039;&amp;#039;&amp;#039;other&amp;#039;&amp;#039;&amp;#039; type. It tells the template to behave like it is on some specific type of page. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = Article text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
|demospace = main&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No matter on what kind of page the code above is used, it will return this:&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = Article text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
|demospace = main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; Example 2&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;page&amp;#039;&amp;#039;&amp;#039; parameter instead takes a normal pagename, making this template behave exactly as if on that page. The pagename doesn&amp;#039;t have to be an existing page. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|user  = User page text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
|page  = User:Example&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No matter on what kind of page the code above is used, it will return this:&lt;br /&gt;
{{Namespace&lt;br /&gt;
|user  = User page text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
|page  = User:Example&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; Example 3&lt;br /&gt;
&lt;br /&gt;
It can be convenient to let your template understand the &amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;page&amp;#039;&amp;#039;&amp;#039; parameter and send it on to the {{T|Namespace}} template. Like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Namespace&lt;br /&gt;
|main  = Article text&lt;br /&gt;
|other = Other pages text&lt;br /&gt;
|demospace = {{{demospace|}}}&lt;br /&gt;
|page  = {{{page|}}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If both the &amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;page&amp;#039;&amp;#039;&amp;#039; parameters are empty or undefined, the template will detect page types as usual.&lt;br /&gt;
&lt;br /&gt;
===Infobox Category Checks===&lt;br /&gt;
In many [[:Category:Infobox Templates|infobox templates]] used throughout the wiki, you&amp;#039;ll often see category checks at the end of the infobox template.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&amp;lt;infobox&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/infobox&amp;gt;&lt;br /&gt;
{{Namespace|main=[[Category:Terminology]]&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{type|}}}|[[Category:{{{type|}}}]]}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{type2|}}}|[[Category:{{{type2|}}}]]}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{type3|}}}|[[Category:{{{type3|}}}]]}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{region|}}}|[[Category:{{{region}}} Terminology]]}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{area|}}}|[[Category:{{{area}}} Terminology]]}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation|type=Infobox}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the {{T|Namespace}} parameter is being used to ensure that the categories only apply to pages in the Main namespace. So if the infobox template happens to be used in template documentation pages or user pages, then the categories won&amp;#039;t be applied.&lt;br /&gt;
&lt;br /&gt;
==Technical details==&lt;br /&gt;
If you intend to feed tables as content to the numbered parameters of this template, you need to know this:&lt;br /&gt;
&lt;br /&gt;
[[m:Help:Templates|Templates]] have a problem handling parameter data that contains pipes &amp;quot;&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;&amp;quot; unless the pipe is inside another template &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{name|param1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or inside a piped link &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[m:Help:Templates|help]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Thus templates can not handle [[m:Help:Tables|wikitables]] as input unless you escape them by using the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; magic word. This makes it hard to use wikitables as parameters to templates. Instead, the usual solution is to use HTML wikimarkup for the table code, which is more robust.&lt;/div&gt;</summary>
		<author><name>ReisuDesign</name></author>
	</entry>
</feed>