Template:LinkTemplate
[[Template:{{{1}}}|{{ {{{1}}} }}]]
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| then | else }}
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
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.