साँचा:LinkTemplate/doc

मुक्त ज्ञानकोश विकिपीडिया से

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 9 subsequent parameters for the template which (if defined) are added to the displayed TemplateName (i.e. {{ TemplateName | param1 | param2 | etc }} ).


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| …}} (Note: optional parameters after the 9th 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]]}}

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, dependant 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}}