Template:Main other and Template:Howto other: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
 
m (Slight clarification)
 
Line 4: Line 4:
   | {{lc: {{{demospace}}} }}    <!--Use lower case "demospace"-->
   | {{lc: {{{demospace}}} }}    <!--Use lower case "demospace"-->
   | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
   | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
     | main
     | howto
     | other
     | other
     }}  
     }}  
   }}
   }}
| main     = {{{1|}}}
| howto     = {{{1|}}}
| other
| other
| #default = {{{2|}}}
| #default = {{{2|}}}
Line 15: 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.  It can also be used for category suppression, to avoid that a page is categorized if it is not in the main namespace
This template can be used to show a different text if it is not used on a page in the howto namespace.  It can also be used for category suppression, to avoid that a page is categorized if it is not in the howto 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}}.


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''main other'''<nowiki>|</nowiki>''text if main''<nowiki>|</nowiki>''text if other'' <nowiki>|</nowiki>''demospace=''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''howto other'''<nowiki>|</nowiki>''text if howto''<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.
All parameters are optional.


; text if otherOptional text to use if the template is on a page in any other namespace.
;text if howtoText to use if the template is on a page in the howto 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.
;text if other:  Text to use if the template is on a page in any other namespace.
 
;demospace:  Namespace override.  If it is empty or undefined the namespace of the page with the template on will be used, if it is '''howto''' then '''text if howto''' 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 ===
  <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>
  <nowiki>Since this is a template page {{howto other|this text will ''not'' be shown|this text ''will'' be shown}}.</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}}.
Since this is a template page {{howto other|this text will ''not'' be shown|this text ''will'' be shown}}.


  <nowiki>However with {{main other|a little bit of cheating|this text will not be shown|demospace=main}}...</nowiki>
  <nowiki>However with {{howto other|a little bit of|some cheating|demospace=howto}}...</nowiki>
However with {{main other|a little bit of cheating|this text will not be shown|demospace=main}}...
However with {{howto other|a little bit of|some cheating|demospace=howto}}...


=== Category suppression ===
=== Category suppression ===
Using the template like this will only categorize a page when it is in the article/main namespace:
Using the template like this will only categorize a page when it is in the main article space:
  <nowiki>{{main other|[[Category:Boeing]]}}</nowiki>
  <nowiki>{{howto other|[[Category:Howto]]}}</nowiki>


== 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}}