Editing
Template:Main other/doc
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{used in system}} {{Template shortcut|ns0|mo|ao}} <!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE --> This is the {{tl|main other}} meta-template. This template helps other templates detect if they are on a main space (article) page or some "other" type of page. ===Basic usage=== This template usually takes two parameters, like this: : {{Tlc|main other |''result if in mainspace'' |''result if elsewhere''}} If the template is on a main space (article) page, it will return this: : {{main other |demospace=main |''result if in mainspace'' |''result if elsewhere''}} If the template is on any other page, it will return this: : {{main other |''result if in mainspace'' |''result if elsewhere''}} A typical usage case could be to make it so that a template only adds a category when on an article. Thus not adding other pages that just show the template. Like this: : {{Tlc|main other |<nowiki>[[:Category:Some article maintenance category]]</nowiki>}} Note that guidelines do not support categorization in templates. Or to warn that a template should not be used on other pages: : {{Tlc|main other | |This template should only be used in articles.}} Note that in the first case above the "other" parameter was not used, and in the second example the "main" parameter was left empty. ===Demospace=== For testing and demonstration purposes, this template can take a parameter named '''demospace'''. * If it has the value '''main''' it returns the article text. * It if has the value '''other''' or any other value such as the name of some other namespace it returns the other pages text. * If the parameter is empty or undefined, the actual page type determines the result. Like this: : {{tlf|main other |''result if in mainspace'' |''result if elsewhere'' |demospace{{=}}main}} No matter on what kind of page the code above is used, it will return: {{main other |''result if in mainspace'' |''result if elsewhere'' |demospace=main}} You can make it so your template also understands the '''demospace''' parameter. That means you can demonstrate the different appearances of your template in the documentation for your template: : {{tlf|main other |''result if in mainspace'' |''result if elsewhere'' |<nowiki>demospace={{{demospace|}}}</nowiki> }} ===Technical details=== This template detects article "Talk:" pages as type '''other'''. This template works like {{tl|main talk other}}. For more examples and technical details, see the documentation there. <templatedata> { "params": { "1": { "label": "If mainspace", "description": "Content if page is located in mainspace (i.e. article space)", "type": "content" }, "2": { "label": "If not mainspace", "description": "Content if page is not located in mainspace", "type": "content" } } } </templatedata> ===Redirects=== * {{tl|article only}} * {{tl|article other}} {{Namespace and pagename-detecting templates}} <includeonly>{{Sandbox other|| [[Category:Namespace manipulation templates]] [[Category:If-then-else templates]] }}</includeonly>
Summary:
Please note that all contributions to The Darts Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
The Darts Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Documentation subpage
(
edit
)
Template:Hlist/styles.css
(
edit
)
Template:Main other
(
edit
)
Template:Mbox
(
edit
)
Template:Namespace and pagename-detecting templates
(
edit
)
Template:Navbox
(
edit
)
Template:No redirect
(
edit
)
Template:Plainlist/styles.css
(
edit
)
Template:Sandbox other
(
edit
)
Template:Str endswith
(
edit
)
Template:Strong
(
edit
)
Template:Template link
(
edit
)
Template:Template link bare
(
edit
)
Template:Template link code
(
edit
)
Template:Template link with link off
(
edit
)
Template:Template shortcut
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Template:Tlbare
(
edit
)
Template:Tlc
(
edit
)
Template:Tlf
(
edit
)
Template:Used in system
(
edit
)
Module:Arguments
(
edit
)
Module:Effective protection level
(
edit
)
Module:High-use
(
edit
)
Module:List
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Navbar
(
edit
)
Module:Navbar/configuration
(
edit
)
Module:Navbar/styles.css
(
edit
)
Module:Navbox
(
edit
)
Module:Navbox/configuration
(
edit
)
Module:Navbox/styles.css
(
edit
)
Module:Redirect
(
edit
)
Module:Shortcut
(
edit
)
Module:Shortcut/config
(
edit
)
Module:Shortcut/styles.css
(
edit
)
Module:String
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/M
(
edit
)
Module:Yesno
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information