پرش به محتوا

الگو:Tlg

از ویکی‌نبشته

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}}
  • tt=yes: Use a monospaced font, like for {{tlx}} and {{tlxb}}
  • code=yes: Use the <code>...</code> HTML attribute (usually a monospaced font), like for {{tlc}}
  • nolink=yes: Don't insert a template link, like for {{tlf}}, {{tld}}, and {{tlc}}
  • anypage=yes: Allow linking to arbitrary page (not just template)
  • 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 Output Remarks
{{tlg|Abc}} {{Abc}}
{{tlg|abC}} {{abC}} template names are case-sensitive
{{tlg|abc}} {{abc}} first letter is case-insensitive though
{{tlg|x0}} {{x0}}
{{tlg|x0|code=on}} {{x0}} <code> style
{{tlg|x0|plaincode=on}} {{x0}} plaincode style
{{tlg|x0|bold=on}} {{x0}} bold link/name
{{tlg|x1|one|italic=on}} {{x1|one}} parameter/s in italics
{{tlg|x0|nolink=on}} {{x0}}
{{tlg|x0|subst=on}} {{subst:x0}}
{{tlg|x0|braceinside=on}} {{x0}}
{{tlg|x0|alttext=x0 link}} {{x0 link}}
{{tlg|x0|bold=on|code=on|braceinside=on}} {{x0}} No reason you can't combine multiple parameter settings
{{tlg|x1|one}} {{x1|one}}
{{tlg|x2|one|two}} {{x2|one|two}}
{{tlg|x2|bold=on|code=on|one|...}} {{x2|one|two}} Can combine named and anonymous parameters …
{{tlg|x2|one|two|bold=on|...}} {{x2|one|two}} … in any order …
{{tlg|x2|one|code=on|two|...}} {{x2|one|two|three}} … even intermixed …
{{tlg|x2|one|code=on|two|...}} {{x2|one|two|three}} … with many different configurations.
{{tlg|x3|1|2|3|...}} {{x3|1|2|3|4|5|6|7|8|9|10}}
{{tlg|x4|1|2|3|...}} {{x4|1|2|3|4|5|6|7|8|9|10|...}} up to 10 parameters, then …
{{tlg|x5|1|2|3|...}} {{x5|1|2|3|4|5|6|7|8|9|10|11}}
{{tlg}} {{Tlg}} with no arguments, the current page name is substituted
{{tlg|x1|x=u}} {{x1|x=u}} = won't work
{{tlg|x1|x&#61;u}} {{x1|x=u}}
{{tlg|x1|x{{=}}u}} {{x1|x=u}}
{{tlg|x1|x<nowiki>=</nowiki>u}} {{x1|x=u}}
{{tlg|x2||two||...}} {{x2|two}} empty parameters work too, even at the end
{{tlg|x2|2=one|two}} {{x2|2=one|two}} two clobbers 2=one
{{tlg|x2|3=two|2=one}} {{x2|3=two|2=one}}
Unlimited parameters as one nowiki string

{{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}}

See also

[ویرایش]

General-purpose formatting

[ویرایش]
  • 1 {{tlg}} is the most general, allowing any combination of text style and/or link style options.
  • 2 Prevents wrapping of text by placing it inside ‎<span class="nowrap">...‎</span> tags.
  • 3 Uses monospace font but not ‎<code>...‎</code>.
  • 4 Allows links to templates in any namespace.