Template:Template other: Difference between revisions

Jump to navigation Jump to search
Clarification; Correction
m (+rel: Template:Namespace detect)
(Clarification; Correction)
Line 22: Line 22:
  <nowiki>{{</nowiki>'''template other'''<nowiki>|</nowiki>''text if template''<nowiki>|</nowiki>''text if other'' <nowiki>|</nowiki>''demospace=''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''template other'''<nowiki>|</nowiki>''text if template''<nowiki>|</nowiki>''text if other'' <nowiki>|</nowiki>''demospace=''<nowiki>}}</nowiki>


;text if template:  Optional text to use if the template is on a page in the template namespace.
; text if template:  Optional text to use if the template is on a page in the template namespace.


;text if other:  Optional text to use if the template is on a page in any other namespace.
; text if other:  Optional text to use if the template is on a page in any other namespace.
 
;demospace:  Optional namespace override.  If it is empty or undefined the namespace of the page with the template on will be used, if it is '''template''' then '''text if template''' will be shown and if it is '''other''' or any other namespace then '''text if other''' will be used.


; demospace:  Optional namespace override.  If it is empty or undefined the namespace of the page with the template on will be used, if it is '''template''' then '''text if template''' will be shown and if it is '''other''' or any other namespace then '''text if other''' will be used.


== Examples ==
== Examples ==
=== Text selection ===
=== Text selection ===
<pre>
<nowiki>Since this is a template page {{template other|this text will be shown|this text will not be shown}}.</nowiki>
Since this is a template page {{template other|this text ''will'' be shown|this text will ''not'' be shown}}.
Since this is a template page {{template other|this text will be shown|this text will not be shown}}.
</pre>
Since this is a template page {{template other|this text ''will'' be shown|this text will ''not'' be shown}}.


<pre>
<nowiki>However with {{template other|a little bit of|some cheating|demospace=other}}...</nowiki>
However with {{template other|a little bit of|some cheating|demospace=other}}...
</pre>
However with {{template other|a little bit of|some cheating|demospace=other}}...
However with {{template other|a little bit of|some cheating|demospace=other}}...


=== Category suppression ===
=== Category suppression ===
Using the template like this will only categorize a page when it is in the main article space:
Using the template like this will only categorize a page when it is in the template namespace:
<pre>
<pre>
{{template other|[[Category:Namespace templates]]}}
{{template other|[[Category:Namespace templates]]}}

Navigation menu