On November 27th, 2022, the 8,000th article was added to the SuccuWiki!

Template:Tlg/doc: Difference between revisions

From SuccuWiki - The Wiki of the Succubi
Jump to navigation Jump to search
(Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> == Explanation == {{tlx|tlg}} ('''<u>t</u>emplate <u>l</u>ink, <u>g</u>ener...")
 
m (Replaced content with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> <includeonly> <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> [[Categor...")
 
Line 2: Line 2:
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


== Explanation ==
<includeonly>
{{tlx|tlg}} ('''<u>t</u>emplate <u>l</u>ink, <u>g</u>eneral''') is a general template for inserting a template link.  It can be used to replace or implement any of the more specific <code><nowiki>{{tl*}}</nowiki></code> templates, e.g. {{tlx|tl}}, {{tlx|tlx}} or {{tlx|tlb}}.  Parameters are:
* {{code|code{{=}}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|bold{{=}}yes}}: '''Boldface''' the text, like for {{tlx|tlb}} and {{tlx|tlxb}}
* {{code|italic{{=}}yes}}: ''Italicizes'' the parameters, like for {{tlx|tlxi}}
* {{code|nolink{{=}}yes}}: Don't insert a template link, like for {{tlx|tlf}}, {{tlx|tld}}, and {{tlx|tlc}}
* {{code|braceinside{{=}}yes}}: Put braces inside the link, like for {{tlx|tn}}
* {{code|subst{{=}}yes}}: Add a {{code|subst:}} prefix, like for {{tlx|tls}}
* {{code|alttext{{=}}FOO}}: Specify alternative surface text for a link, like for {{tlx|tla}}
* {{code|nowrap{{=}}yes}}: Prevent line breaks in output
 
== Examples ==
{{#ifeq:{{SITENAME}}|Wikipedia|<!-- Skip message--->|
{{#ifeq:{{SITENAME}}|Meta|<!-- No note needed --->|<!-- Other Sisters Note: --->
;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.
}}}}
 
{| border="1" cellpadding="4" class="wikitable"
! Code
! Result
! Remark
|-
|{{Tlx|Tlg|Abc}}
|{{Tlg|Abc}}
|&nbsp;
|-
|{{Tlx|Tlg|abC}}
|{{Tlg|abC}}
|template names are case-sensitive
|-
|{{Tlx|Tlg|abc}}
|{{Tlg|abc}}
|first letter is case-insensitive though
|-
|{{Tlx|Tlg|x0}}
|{{Tlg|x0}}
|&nbsp;
|-
|{{Tlx|Tlg|x0|code{{=}}yes}}
|{{Tlg|x0|code=yes}}
|code style
|-
|{{Tlx|Tlg|x0|bold{{=}}yes}}
|{{Tlg|x0|bold=yes}}
|bold style
|-
|{{Tlx|Tlg|x1|one|italic{{=}}yes}}
|{{Tlg|x1|one|italic=yes}}
|italic style
|-
|{{Tlx|Tlg|x0|nolink{{=}}yes}}
|{{Tlg|x0|nolink=yes}}
|&nbsp;
|-
|{{Tlx|Tlg|x0|subst{{=}}yes}}
|{{Tlg|x0|subst=yes}}
|&nbsp;
|-
|{{Tlx|Tlg|x0|braceinside{{=}}yes}}
|{{Tlg|x0|braceinside=yes}}
|&nbsp;
|-
|{{Tlx|Tlg|x0|alttext{{=}}Link to x0 template}}
|{{Tlg|x0|alttext=Link to x0 template}}
|&nbsp;
|-
|{{Tlx|Tlg|x0|bold{{=}}yes|code{{=}}yes|braceinside{{=}}yes}}
|{{Tlg|x0|bold=yes|code=yes|braceinside=yes}}
|No reason you can't combine multiple parameter settings.
|-
|{{Tlx|Tlg|x1|one}}
|{{Tlg|x1|one}}
|&nbsp;
|-
|{{Tlx|Tlg|x2|one|two}}
|{{Tlg|x2|one|two}}
|&nbsp;
|-
|{{Tlx|Tlg|x2|bold{{=}}yes|code{{=}}yes|one|two}}
|{{Tlg|x2|bold=yes|code=yes|one|two}}
|Can combine named and anonymous parameters …
|-
|{{Tlx|Tlg|x2|one|two|bold{{=}}yes|code{{=}}yes}}
|{{Tlg|x2|one|two|bold=yes|code=yes}}
|… in any order …
|-
|{{Tlx|Tlg|x2|one|code{{=}}yes|two|bold{{=}}yes|three}}
|{{Tlg|x2|bold=yes|one|code=yes|two|bold=yes|three}}
|… even intermixed …
|-
|{{Tlx|Tlg|x2|one|code{{=}}yes|two|bold{{=}}yes|three|italic{{=}}yes}}
|{{Tlg|x2|bold=yes|one|code=yes|two|bold=yes|three|italic=yes}}
|… with many different configurations.
|-
|{{Tlx|Tlg|x3|1|2|3|4|5|6|7|8|9&#124;10}}
|{{Tlg|x3|1|2|3|4|5|6|7|8|9|10}}
|&nbsp;
|-
|{{Tlx|Tlg|x4|1|2|3|4|5|6|7|8|9&#124;10&#124;11}}
|{{Tlg|x4|1|2|3|4|5|6|7|8|9|10|11}}
|up to 10 parameters, then …
|-
|{{Tlx|Tlg|x5|1|2|3|4|5|6|7|8|9&#124;10&amp;#124;11}}
|{{Tlg|x5|1|2|3|4|5|6|7|8|9|10&#124;11}}
|align="right"|<code>&amp;#124;</code> for more
|-
|colspan=2| {{Tlx|Tlg|convert|<nowiki>&lt;nowiki>14|m|ftin|abbr=out|sp=us&lt;/nowiki></nowiki>}}
|unlimited parameters as one nowiki string
|-
|{{Tlx|Tlg}}
|{{Tlg}}
|with no arguments, the current page name is substituted
|-
|{{Tlx|Tlg|x1|x&#61;u}}
|{{Tlg|x1|x=u}}
|'''=''' won't work
|-
|{{Tlx|Tlg|x1|x&amp;#61;u}}
|{{Tlg|x1|x&#61;u}}
|align="right"|<code>&amp;#61;</code> is okay
|-
|{{Tlx|Tlg|x1|x<nowiki>{{=}}</nowiki>u}}
|{{Tlg|x1|x{{=}}u}}
|align="right"|<code><nowiki>{{=}}</nowiki></code> is okay
|-
|{{Tlx|Tlg|x1|x&lt;nowiki&gt;&#61;&lt;/nowiki&gt;u}}
|{{Tlg|x1|x<nowiki>=</nowiki>u}}
|align="right"|sticky nowiki is okay
|-
|{{Tlx|Tlg|x2|<nowiki />|two|<nowiki />|<nowiki />}}
|{{Tlg|x2||two||}}
|empty parameters work too, even at the end
|-
|{{Tlx|Tlg|x2|<nowiki>2=one</nowiki>|two}}
|{{Tlg|x2|2=one|two}}
|'''two''' clobbers '''2=one'''
|-
|{{Tlx|Tlg|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}}
|{{Tlg|x2|3=two|2=one}}
|align="right"|right to left okay
|}
 
{{tl-nav}}<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Typing-aid templates]]
[[Category:Typing-aid templates]]
[[Category:Internal link templates]]
[[Category:Internal link templates]]
</includeonly>
</includeonly>

Latest revision as of 12:53, 30 June 2013