83,675
edits
Hoof Hearted (talk | contribs) m (Protected "Template:Namespace detect showall/doc": High importance template ([Move=Allow only administrators] (indefinite))) |
Hoof Hearted (talk | contribs) (fix redirects, wikilinks) |
||
Line 5: | Line 5: | ||
It helps other templates detect what type of page they are on. It is an extended version of {{Template|Namespace detect}}. | It helps other templates detect what type of page they are on. It is an extended version of {{Template|Namespace detect}}. | ||
This template detects and groups all the different | This template detects and groups all the different {{Wp|Namespace#Enumeration|namespaces}} used on WikiIndex into several types: | ||
:'''main''' = Main/article space, as in normal WikiIndex | :'''main''' = Main/article space, as in normal WikiIndex [[article]]s; | ||
:'''talk''' = any talk space, such as page names that start with | :'''talk''' = any talk space, such as page names that start with 'Talk:', '[[User talk]]:', 'File talk:' and so on; | ||
:'''User, WikiIndex, File, MediaWiki, Template, Help, Category, Portal''' and '''Book''' = the other namespaces except the talk pages; | :'''User, WikiIndex, File, MediaWiki, Template, Help, Category, Portal''' and '''Book''' = the other namespaces except the talk pages; | ||
:'''other''' = any namespaces that were not specified as a parameter to the template; see explanation below. | :'''other''' = any [[WikiIndex:Namespace conventions|namespaces]] that were not specified as a parameter to the template; see explanation below. | ||
;''Note | ;''Note | ||
Line 27: | Line 27: | ||
}}</pre> | }}</pre> | ||
If the template is on a main (article) page, it will return this: | If the template is on a main ([[article]]) page, it will return this: | ||
:{{Namespace detect showall | :{{Namespace detect showall | ||
|1= Article text. | |1= Article text. | ||
Line 38: | Line 38: | ||
}} | }} | ||
If the template is on any ''other'' page than an article or a talk page, it will return this: | If the template is on any ''other'' page than an article or a [[talk page]], it will return this: | ||
:{{Namespace detect showall | :{{Namespace detect showall | ||
|1 Article text. | |1 Article text. | ||
Line 237: | Line 237: | ||
If you intend to feed tables as content to the numbered parameters of this template, then you need to know this: | If you intend to feed tables as content to the numbered parameters of this template, then you need to know this: | ||
{{Mw|Help:Template|Templates}} do have a problem to handle parameter data that contains pipes '<code>|</code>', unless the pipe is inside another template <code><nowiki>{{name|param1}}</nowiki></code>, or inside a piped link <code><nowiki>[[Help:Template|help]]</nowiki></code>. Thus templates can not handle {{Mw|Help:Table|wikitables}} as input, unless you escape them by using the {{Template|!}} template. This makes it hard to use wikitables as parameters to templates. Instead, the usual solution is to use '{{Mw|Help:HTML in wikitext|HTML wikimarkup}}' for the table code, which is more robust. | |||
For more technical details such as about 'copying to other projects' and 'CSS based namespace detection', see {{Template|main talk other}} and its talk page. | For more technical details such as about 'copying to other projects' and 'CSS based namespace detection', see {{Template|main talk other}} and its talk page. | ||
{{ | {{Wp|Template:Namespace and pagename-detecting templates}} | ||
<includeonly>{{Sandbox other| | <includeonly>{{Sandbox other| |
edits