Template:Main other: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Adding the howto namespace)
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
     }}  
     }}  
   }}
   }}
| howto
| main    = {{{1|}}}
| main    = {{{1|}}}
| other
| other
Line 16: Line 15:
__NOTOC__
__NOTOC__
== Goal ==
== 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, or the howto namespace.  It can also be used for category suppression, to avoid that a page is categorized if it is not in the main or howto namespaces.
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


If more than one namespace need to be handled, use {{tl|namespace detect}}.
If more than one namespace need to be handled, use {{tl|namespace detect}}.
Line 23: Line 22:
  <nowiki>{{</nowiki>'''main other'''<nowiki>|</nowiki>''text if main''<nowiki>|</nowiki>''text if other'' <nowiki>|</nowiki>''demospace=''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''main other'''<nowiki>|</nowiki>''text if main''<nowiki>|</nowiki>''text if 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 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.
; 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.


; 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 ==
== Examples ==
=== Text selection ===
=== Text selection ===
<pre>
<nowiki>Since this is not a page in the main namespace/article {{main other|this text will not be shown|this text will be shown}}.</nowiki>
Since this is a template page {{main other|this text will ''not'' be shown|this text ''will'' be shown}}.
Since this is not a page in the main namespace/article {{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>
<nowiki>However with {{main other|a little bit of cheating|this text will not be shown|demospace=main}}...</nowiki>
However with {{main other|a little bit of|some cheating|demospace=main}}...
However with {{main other|a little bit of cheating|this text will not be shown|demospace=main}}...
</pre>
However with {{main other|a little bit of|some cheating|demospace=main}}...


=== 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 article/main namespace:
<pre>
<nowiki>{{main other|[[Category:Boeing]]}}</nowiki>
{{main other|[[Category:Boeing]]}}
</pre>


== Related templates ==
== Related templates ==
* {{tl|talk other}}
* {{tl|talk other}}
* {{tl|user other}}
* {{tl|user other}}
* {{tl|user talk other}}
* {{tl|file other}}
* {{tl|file other}}
* {{tl|template other}}
* {{tl|template other}}

Latest revision as of 05:51, 18 April 2016


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

If more than one namespace need to be handled, use {{namespace detect}}.

Usage

{{main other|text if main|text if 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 not a page in the main namespace/article {{main other|this text will not be shown|this text will be shown}}.

Since this is not a page in the main namespace/article this text will be shown.

However with {{main other|a little bit of cheating|this text will not be shown|demospace=main}}...

However with a little bit of cheating...

Category suppression

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

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

Related templates