Template:Talkspace detect
From OpenWetWare
Jump to navigationJump to search
The {{talkspace detect}} meta-template helps other templates detect what type of page they are on. It detects and groups all the different talkspaces used on Wikipedia into several types:
- main = Defines the output if the template is located on main/article talkspace; aka Talk:.
- user, wikipedia, file, mediawiki, template, help, category and portal = Defines the output if the template is located on the specified talkspaces; aka User talk:, Wikipedia talk:, File talk:, etc.
- default = Defines the output if the template is located on any talkspaces that were not defined as a parameter in this meta-template.
- other = Defines the output if the template is located on any namespaces (not the associated talkspace).
Usage
This template takes one or more parameters named after the different page types as listed above. Like this:
{{talkspace detect | main = Article talk page text | user = User talk page text | default = Text for all other namespace talk pages | other = Text for all namespaces }}
By using an empty parameter you can make it so the template doesn't render anything for some specific page type. Like this:
{{talkspace detect | main = | default = Text for all other namespace talk pages }}
See also
Easy to use namespace-detection templates:
- {{main other}} – For article templates.
- {{talk other}} – For talk page templates.
- {{user other}} – For user page templates.
- {{wikipedia other}} – For detecting "Wikipedia:" pages.
- {{file other}} – For file (image) templates.
- {{template other}} – For detecting template pages.
- {{help other}} – For help page templates.
- {{category other}} – For category templates.
- {{portal other}} – For portal templates.
More complex namespace-detection templates:
- {{main talk other}} – Separates some namespaces.
- {{main talk category other}} – Separates some more namespaces.
- {{namespace detect}} – The very versatile one.
- {{namespace detect showall}} – The extremely versatile one.
- {{talkspace detect}} - For detecting talk pages on various namespaces.
Technical stuff:
- Wikipedia:Namespace – Lists all the namespaces.
- mw:Help:Magic words – About
{{NAMESPACE}}
etc. - mw:Help:Extension:ParserFunctions – About
{{#ifeq:|||}}
etc.