Template:Talkspace detect/doc: Difference between revisions

Content deleted Content added
remove book
m syntaxhighlight lang="wikitext"
 
(One intermediate revision by one other user not shown)
Line 1:
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{high-use|354133}}
 
This is the {{tl|talkspace detect}} meta-template.
Line 15:
This template takes one or more parameters named after the different page types as listed above. Like this:
 
<syntaxhighlight lang="wikitext">
<pre>
{{talkspace detect
| main = Article talk page text
Line 22:
| other = Text for all subject spaces
}}
</syntaxhighlight>
</pre>
 
By using an empty parameter you can make it so this template doesn't render anything for some specific page type. Like this:
 
<syntaxhighlight lang="wikitext">
<pre>
{{talkspace detect
| main =
| default = Text for all other talkspaces
}}
</syntaxhighlight>
</pre>
 
=== The "page" parameter ===
For testing and demonstration purposes this template can take a parameter named '''page'''. Like this:
 
<syntaxhighlight lang="wikitext">
<pre>
{{talkspace detect
| user = User talk text.
Line 42:
| page = User talk:Example
}}
</syntaxhighlight>
</pre>
 
No matter on what kind of page the code above is used it will return this:
Line 58:
You can make it so your template also understands the '''page''' parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:
 
<syntaxhighlight lang="wikitext">
<pre>
{{talkspace detect
| user = User talk text.
Line 64:
| page = {{{page|}}}
}}
</syntaxhighlight>
</pre>
 
 
Line 75:
[[Category:Wikipedia metatemplates]]
 
[[zh:Template:Talkspace detect]]
}}</includeonly>