Help:Templates: Difference between revisions

Jump to navigation Jump to search
m
(→‎Translating templates: More detailed instruction on translating templates)
Line 163: Line 163:
  <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>


If the template is put on a page in the main namespace, the the namespace that articles are in, the ''text if main'' text is used.  Otherwise ''text if other'' is used.  Both can be overridden if ''demospace='' is set as ''other'' when in the main namespace and ''main'' when in any other.
If the template is put on a page in the main namespace, the the namespace that articles are in, '''text if main''' text is used.  Otherwise '''text if other''' is used.  Both can be overridden if '''demospace''' is set as '''demospace = other''' when in the main namespace and '''demospace = main''' when in any other.


If a category link is used in ''text if main'' like below the page will only be categorized if the template is put in the main namespace. Note that all the parameters are optional.
If a category link is used in '''text if main''' like below the page will only be categorized if the template is put in the main namespace. Note that all the parameters are optional.


  <nowiki>
  <nowiki>
Line 174: Line 174:
</noinclude></nowiki>
</noinclude></nowiki>


Apart from <tt>demospace=</tt> some templates will have a <tt>nocat=</tt> parameter that when not empty or with the value <tt>yes</tt> will suppress categorisation altogether.
Apart from '''demospace''' some templates will have a '''nocat''' parameter that when not empty or set as '''nocat = yes''' will suppress categorisation altogether.


== Translating templates ==
== Translating templates ==

Navigation menu