Template:LinkTemplate/doc

From MOASSpedia
Jump to navigation Jump to search

Returns a link (uncoloured/base-font), in the form [[Template:TemplateName|<nowiki>{{TemplateName| params}}</nowiki>]].

Usage

{{LinkTemplate | TemplateName | params }}

where

  1   TemplateName     is the name of the Template to be linked;  
2+ params [optionally] up to 20 subsequent parameters for the template which (if defined) are added to the displayed TemplateName (i.e. {{ TemplateName | param1 | param2 | etc }} ).  Parameters after the 20th are currently ignored and shown as " | …  "
Note: If included within any parameter value, the "=" (equals sign) must be entered using the template, as in "{{ =}}".

Examples

{{LinkTemplate|color|colorcode}}

yields

{{ color| colorcode}}

{{LinkTemplate|TemplateName|Param1|P2|P3|P4|P5|P6|P7|P8|P9|P10|P11}}

yields   (red-linked since "Template:TemplateName" doesn't exist)

{{ TemplateName| Param1| P2| P3| P4| P5| P6| P7| P8| P9| P10| P11}}

{{LinkTemplate|Count|Param1|P2|P3|P4|P5|P6|P7|P8|P9|P10|P11|P12|P13|P14|P15|P16|P17|P18|P19|P20|P21|P22}}

yields

{{ Count| Param1| P2| P3| P4| P5| P6| P7| P8| P9| P10| P11| P12| P13| P14| P15| P16| P17| P18| P19| P20| …}} 
(Note: optional parameters after the 20th are currently ignored)

{{LinkTemplate|LinkTemplate|Param1|P2|||P5||P7|P8}}

yields   (not a link since "Template:LinkTemplate" can't link to itself)

{{ LinkTemplate| Param1| P2| | | P5| | P7| P8}}

{{LinkTemplate|ifeq|compare|value| &nbsp;then&nbsp; | &nbsp;else&nbsp; }}

yields

{{ ifeq| compare| value|  then |  else }}

{{LinkTemplate|ifeq|compare|value| <nowiki>[[Template:ifeqany]]</nowiki> | <nowiki>[[Template:ifeqall]]</nowiki> }}

yields

{{ ifeq| compare| value| [[Template:ifeqany]]| [[Template:ifeqall]]}}

{{LinkTemplate|Current hour offset in time zone|time zone [|dst=no] }}

yields   (parameter dst is missing because LinkTemplate tries to interpret the equals sign in "|dst=no")

{{ Current hour offset in time zone| time zone [}}

{{LinkTemplate|Current hour offset in time zone|time zone [|dst{{=}}no] }}

yields the desired result

{{ Current hour offset in time zone| time zone [| dst=no]}}


May be used in-line to create a reference, such as {{ color| colorcode}}, to a template within the body of a paragraph.  The inclusion of parameters is entirely optional, dependent upon whether their listing is desired; the template alone may be referenced as in {{ color}} by simply excluding the parameters from the call to {{ LinkTemplate}}.

See also

{{ tl}}