Template:Template link general/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(empty nowiki string example)
(→‎Explanation: there is no difference between |code=yes and |tt=yes)
Line 6: Line 6:
* {{code|bold{{=}}yes}}: '''Boldface''' the text, like for {{tlx|tlb}} and {{tlx|tlxb}}
* {{code|bold{{=}}yes}}: '''Boldface''' the text, like for {{tlx|tlb}} and {{tlx|tlxb}}
* {{code|italic{{=}}yes}}: ''Italicizes'' the parameters, like for {{tlx|tlxi}}
* {{code|italic{{=}}yes}}: ''Italicizes'' the parameters, like for {{tlx|tlxi}}
* {{code|tt{{=}}yes}}: Use a <tt>monospaced</tt> font, like for {{tlx|tlx}} and {{tlx|tlxb}}
* {{code|code{{=}}yes}} or {{code|tt{{=}}yes}}: Use the <code><nowiki><code>...</code></nowiki></code> HTML attribute (usually a monospaced font), like for {{tlx|tlc}} {{tlx|tlx}} and {{tlx|tlxb}}
* {{code|code{{=}}yes}}: Use the <code><nowiki><code>...</code></nowiki></code> HTML attribute (usually a monospaced font), like for {{tlx|tlc}}
* {{code|nolink{{=}}yes}}: Don't insert a template link, like for {{tlx|tlf}}, {{tlx|tld}}, and {{tlx|tlc}}
* {{code|nolink{{=}}yes}}: Don't insert a template link, like for {{tlx|tlf}}, {{tlx|tld}}, and {{tlx|tlc}}
* {{code|anypage{{=}}yes}}: Allow linking to arbitrary page (not just template), as with {{tlx|tlu}}
* {{code|anypage{{=}}yes}}: Allow linking to arbitrary page (not just template), as with {{tlx|tlu}}

Revision as of 06:37, April 13, 2013

Explanation

{{tlg}} (template link, general) is a general template for inserting a template link. It can be used to replace or implement any of the more specific {{tl*}} templates, e.g. {{tl}}, {{tlx}} or {{tlb}}. Parameters are:

  • bold=yes: Boldface the text, like for {{tlb}} and {{tlxb}}
  • italic=yes: Italicizes the parameters, like for {{tlxi}}
  • code=yes or tt=yes: Use the <code>...</code> HTML attribute (usually a monospaced font), like for {{tlc}} {{tlx}} and {{tlxb}}
  • nolink=yes: Don't insert a template link, like for {{tlf}}, {{tld}}, and {{tlc}}
  • anypage=yes: Allow linking to arbitrary page (not just template), as with {{tlu}}
  • braceinside=yes: Put braces inside the link, like for {{tn}}
  • subst=yes: Add a subst: prefix, like for {{tls}}
  • alttext=FOO: Specify alternative surface text for a link, like for {{tla}}

Examples

Note
On the source sister projects, en.wikipedia and Meta, X0, X1, X2,..., X9 are sandbox templates for experimentation on involved templates that need be in template space. An auto-cleansing software facility exists that might be used to duplicate the facility on other Sister projects.
Code Result Remark
{{Tlg|Abc}} {{Template:!((:Template:Abc|Abc]]}}  
{{Tlg|ABC}} {{Template:!((:Template:ABC|ABC]]}}  
{{Tlg|AbC}} {{Template:!((:Template:AbC|AbC]]}}  
{{Tlg|x0}} {{Template:!((:Template:X0|x0]]}}  
{{Tlg|x0|bold=yes}} {{Template:!((:Template:X0|x0]]}}  
{{Tlg|x1|one|italic=yes}} {{Template:!((:Template:X1|x1]]|one}}  
{{Tlg|x0|code=yes}} {{Template:!((:Template:X0|x0]]}}  
{{Tlg|x0|tt=yes}} {{Template:!((:Template:X0|x0]]}}  
{{Tlg|x0|nolink=yes}} {{x0}}  
{{Tlg|x0|subst=yes}} {{subst:Template:!((:Template:X0|x0]]}}  
{{Tlg|x0|braceinside=yes}} Template:!((:Template:X0|{{x0}}]]  
{{Tlg|x0|alttext=Link to x0 template}} {{Template:!((:Template:X0|Link to x0 template]]}}  
{{Tlg|x0|anypage=yes}} {{Template:!((:Template:X0|x0]]}} Now the expression links to x0 (the spaceship, genetic disease, etc.) rather than Template:x0. Mostly useful for templates in user space.
{{Tlg|x0|bold=yes|tt=yes|braceinside=yes}} Template:!((:Template:X0|{{x0}}]] No reason you can't combine multiple parameter settings.
{{Tlg|x1|one}} {{Template:!((:Template:X1|x1]]|one}}  
{{Tlg|x2|one|two}} {{Template:!((:Template:X2|x2]]|one|two}}  
{{Tlg|x2|bold=yes|tt=yes|one|two}} {{Template:!((:Template:X2|x2]]|one|two}} Can combine named and anonymous parameters ...
{{Tlg|x2|one|two|bold=yes|tt=yes}} {{Template:!((:Template:X2|x2]]|one|two}} ... in any order …
{{Tlg|x2|one|tt=yes|two|bold=yes|three}} {{Template:!((:Template:X2|x2]]|one|two|three}} ... even intermixed ...
{{Tlg|x2|one|tt=yes|two|bold=yes|three|italic=yes}} {{Template:!((:Template:X2|x2]]|one|two|three}} ... with many different configurations.
{{Tlg|x3|1|2|3|4|5|6|7|8|9|10}} {{Template:!((:Template:X3|x3]]|1|2|3|4|5|6|7|8|9|10}}  
{{Tlg|x4|1|2|3|4|5|6|7|8|9|10|11}} {{Template:!((:Template:X4|x4]]|1|2|3|4|5|6|7|8|9|10|...}} up to 10 parameters, then ...
{{Tlg|x5|1|2|3|4|5|6|7|8|9|10&#124;11}} {{Template:!((:Template:X5|x5]]|1|2|3|4|5|6|7|8|9|10|11}} &#124; for more
{{Tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} unlimited parameters as one nowiki string
{{Tlg}} {{Template:!((:Template:Template link general/doc|Template link general/doc]]}} with no arguments, the current page name is substituted
{{Tlg|x1|x=u}} {{Template:!((:Template:X1|x1]]}} = won't work
{{Tlg|x1|x&#61;u}} {{Template:!((:Template:X1|x1]]|x=u}} &#61; is okay
{{Tlg|x1|x{{=}}u}} {{Template:!((:Template:X1|x1]]|x=u}} {{=}} is okay
{{Tlg|x1|<nowiki>x=u</nowiki>}} {{Template:!((:Template:X1|x1]]|x=u}} sticky nowiki is okay
{{Tlg|x2| |two}} {{Template:!((:Template:X2|x2]]||two}} empty won't work
{{Tlg|x2|&#32;|two}} {{Template:!((:Template:X2|x2]]| |two}} &#32; is okay
{{Tlg|x2|&nbsp;|two}} {{Template:!((:Template:X2|x2]]| |two}} &nbsp; is okay
{{Tlg|x2|&#124; two}} {{Template:!((:Template:X2|x2]]| | two}} &#124; is okay
{{Tlg|x2|{{!}} two}} {{Template:!((:Template:X2|x2]]| | two}} {{Template:!((:Template:!|!]]}} is dubious
{{Tlg|x2|<nowiki/>|two}} {{Template:!((:Template:X2|x2]]||two}} empty nowiki string works
{{Tlg|x2|2=|3=two}} {{Template:!((:Template:X2|x2]]||two}} empty really doesn't work
{{Tlg|x2|2=one|two}} {{Template:!((:Template:X2|x2]]|two}} two clobbers 2=one
{{Tlg|x2|3=two|2=one}} {{Template:!((:Template:X2|x2]]|one|two}} right to left okay