<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki.shayvam.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%3ANamespace_detect%2Fdoc</id>
	<title>Шаблон:Namespace detect/doc - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.shayvam.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%3ANamespace_detect%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.shayvam.ru/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:Namespace_detect/doc&amp;action=history"/>
	<updated>2026-12-05T19:23:08Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.shayvam.ru/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:Namespace_detect/doc&amp;diff=925&amp;oldid=prev</id>
		<title>Itonohito: 1 версия: Imported by Itonohito</title>
		<link rel="alternate" type="text/html" href="https://wiki.shayvam.ru/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:Namespace_detect/doc&amp;diff=925&amp;oldid=prev"/>
		<updated>2011-05-09T18:17:11Z</updated>

		<summary type="html">&lt;p&gt;1 версия: Imported by Itonohito&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
{{ambox&lt;br /&gt;
| type = move&lt;br /&gt;
| text = &amp;#039;&amp;#039;&amp;#039;Namespace &amp;quot;Image&amp;quot; might change name to &amp;quot;File&amp;quot;.&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt; On 7 October 2008 [[Wikipedia:Village pump (technical)#Canonical namespace change coming: Image: -&amp;gt; File:|it was announced]] at the Village pump that the &amp;quot;image&amp;quot; namespace is probably going to be renamed to &amp;quot;file&amp;quot; at about 13 October. This template has been updated to understand both names. Thus this template will continue to work as before. &amp;lt;br&amp;gt; --[[User:Davidgothberg|David Göthberg]] ([[User talk:Davidgothberg|talk]]) 06:50, 7 October 2008 (UTC)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the {{tl|namespace detect}} meta-template.&lt;br /&gt;
&lt;br /&gt;
It helps other templates detect what type of page they are on.&lt;br /&gt;
&lt;br /&gt;
It detects and groups all the different [[Wikipedia:Namespace#Enumeration|namespaces]] used on Wikipedia into several types:&lt;br /&gt;
&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039; = Main/article space, as in normal Wikipedia articles.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;talk&amp;#039;&amp;#039;&amp;#039; = Any talk space, such as page names that start with &amp;quot;Talk:&amp;quot;, &amp;quot;User talk:&amp;quot;, &amp;quot;Image talk:&amp;quot; and so on.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;user, wikipedia, image, mediawiki, template, help, category&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;portal&amp;#039;&amp;#039;&amp;#039; = The other namespaces except the talk pages.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;other&amp;#039;&amp;#039;&amp;#039; = Any namespaces that were not specified as a parameter to the template. See explanation below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note!&amp;#039;&amp;#039;&amp;#039; 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. &lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
This template takes one or more parameters named after the different page types as listed above. Like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{namespace detect&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;
&lt;br /&gt;
:{{namespace detect| 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;
&lt;br /&gt;
:{{namespace detect&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;
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 then it will not return anything for the other page types. Like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{namespace detect&lt;br /&gt;
| image    = Image 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 image 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 detect&lt;br /&gt;
| image    = Image page text&lt;br /&gt;
| category = Category page text&lt;br /&gt;
| other    =&lt;br /&gt;
}}&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;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{namespace detect&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;
&lt;br /&gt;
:{{namespace detect&lt;br /&gt;
| main  =&lt;br /&gt;
| other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Demospace ===&lt;br /&gt;
&lt;br /&gt;
For testing and demonstration purposes this template can take a parameter named &amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039;. Demospace 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;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{namespace detect | demospace = main&lt;br /&gt;
| main  = Article 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;
No matter on what kind of page the code above is used it will return this:&lt;br /&gt;
&lt;br /&gt;
:{{namespace detect | demospace = main&lt;br /&gt;
| main  = Article text&lt;br /&gt;
| other = Other pages text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It can be convenient to let your template understand the demospace parameter and send it on to the {{tl|namespace detect}} template. Then do like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{namespace detect&lt;br /&gt;
| demospace = {{{demospace|}}}&lt;br /&gt;
| main      = Article 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 &amp;#039;&amp;#039;&amp;#039;demospace&amp;#039;&amp;#039;&amp;#039; parameter is empty or undefined then the template will detect page types as usual.&lt;br /&gt;
&lt;br /&gt;
=== Technical details ===&lt;br /&gt;
&lt;br /&gt;
If you intend to feed tables as content to the numbered parameters of this template, then you need to know this:&lt;br /&gt;
&lt;br /&gt;
[[Help:Template|Templates]] do have a problem to handle 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;[[Help:Template|help]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Thus templates can not handle [[Help:Table|wikitables]] as input unless you escape them by using the {{tn|!}} template. This makes it hard to use wikitables as parameters to templates. Instead the usual solution is to use &amp;quot;[[Help:HTML in wikitext|HTML wikimarkup]]&amp;quot; for the table code, which is more robust.&lt;br /&gt;
&lt;br /&gt;
For more technical details such as about &amp;quot;copying to other projects&amp;quot; and &amp;quot;CSS based namespace detection&amp;quot; see {{tl|main talk other}} and its talk page.&lt;br /&gt;
&lt;br /&gt;
=== См. также ===&lt;br /&gt;
&lt;br /&gt;
Easy to use namespace-detection templates:&lt;br /&gt;
&lt;br /&gt;
* {{tl|main other}} – For article templates.&lt;br /&gt;
* {{tl|talk other}} – For talk page templates.&lt;br /&gt;
* {{tl|image other}} – For image templates.&lt;br /&gt;
* {{tl|category other}} – For category templates.&lt;br /&gt;
&lt;br /&gt;
* {{tl|main talk other}} – Separates some namespaces.&lt;br /&gt;
* {{tl|main talk category other}} – Separates some more namespaces.&lt;br /&gt;
&lt;br /&gt;
* {{tl|namespace detect}} – The very versatile one.&lt;br /&gt;
* {{tl|namespace detect showall}} – The extremely versatile one.&lt;br /&gt;
&lt;br /&gt;
Technical stuff:&lt;br /&gt;
&lt;br /&gt;
* [[Wikipedia:Namespace]] – Lists all the namespaces.&lt;br /&gt;
* [[Help:Magic words]] – About &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{NAMESPACE}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
* [[meta:Help:ParserFunctions]] – About &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#ifeq:|||}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- CATEGORIES AND INTERWIKIS HERE, THANKS --&amp;gt;&lt;br /&gt;
[[Категория:Шаблоны:Для шаблонов|{{PAGENAME}}]]&lt;br /&gt;
&lt;br /&gt;
[[sr:Шаблон:Namespace detect]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{translate}}&lt;br /&gt;
[[Категория:Шаблоны:Документация|{{PAGENAME}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Itonohito</name></author>
	</entry>
</feed>