Template:Main other: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "{{#switch: <!--If no or empty "demospace" parameter then detect namespace--> {{#if:{{{demospace|}}} | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"--> | ...")
 
(+doc — This template together with doc was copied and hand manipulated into the other "Template:* other" themplates)
Line 11: Line 11:
| other
| other
| #default = {{{2|}}}
| #default = {{{2|}}}
}}<noinclude>
{{Informative template|1=
__NOTOC__
== Goal ==
This template can be used to show a different text if it is not used on a page in the main namespace, the namespace used for articles.  It can also be used for category suppression, to avoid that a page is categorized if it is not in the main namespace
== Usage ==
<nowiki>{{</nowiki>'''main other'''<nowiki>|</nowiki>''text on article''<nowiki>|</nowiki>''text on other'' <nowiki>|</nowiki>''demospace=''<nowiki>}}</nowiki>
;text if main:  Optional text to use if the template is on a page in the main 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 '''main''' then '''text if main''' will be shown and if it is '''other''' or any other namespace then '''text if other''' will be used.
== Examples ==
=== Text selection ===
<pre>
Since this is a template page {{main other|this text will ''not'' be shown|this text ''will'' be shown}}.
</pre>
Since this is a template page {{main other|this text will ''not'' be shown|this text ''will'' be shown}}.
<pre>
However with {{main other|a little bit of|some cheating|demospace=main}}...
</pre>
However with {{main other|a little bit of|some cheating|demospace=main}}...
=== Category suppression ===
Using the template like this will only categorize a page when it is in the main article space:
<pre>
{{main other|[[Category:Boeing]]}}
</pre>
== Related templates ==
* {{tl|main other}}
* {{tl|talk other}}
* {{tl|user other}}
* {{tl|file other}}
* {{tl|template other}}
* {{tl|help other}}
* {{tl|category other}}
}}
}}
[[Category:Namespace templates]]
</noinclude>

Revision as of 00:29, 15 November 2013


The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used to show a different text if it is not used on a page in the main namespace, the namespace used for articles. It can also be used for category suppression, to avoid that a page is categorized if it is not in the main namespace

Usage

{{main other|text on article|text on other |demospace=}}
text if main
Optional text to use if the template is on a page in the main 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 main then text if main will be shown and if it is other or any other namespace then text if other will be used.


Examples

Text selection

Since this is a template page {{main other|this text will ''not'' be shown|this text ''will'' be shown}}.

Since this is a template page this text will be shown.

However with {{main other|a little bit of|some cheating|demospace=main}}...

However with a little bit of...

Category suppression

Using the template like this will only categorize a page when it is in the main article space:

{{main other|[[Category:Boeing]]}}

Related templates