Template talk:Tlx

From Wikipedia, the free encyclopedia

Contents

[edit] Documentation

{{Tlx}} is a generalization of {{tl|x}}, {{tlp|x|y}}, {{tl2|x|y|z}}, etc. with arguably better readable output. This depends on the browser, but too narrow uses of "{", "|", "}" in conjunction with links can be hard to read.

[edit] Usage

{{Tlx|template name}}
{{Tlx|template name|param}}
{{Tlx|template name|1|2|3}}
{{Tlx|template name|1|2|3|more}}
{{Tlx|template name|param=value}}

Up to three placeholders for parameters of the specified template

[edit] Example

Code Result Remark
{{tlx|x0}} {{x0}}  
{{tlx|x1|one}} {{x1|one}}  
{{tlx|x2|one|two}} {{x2|one|two}}  
{{tlx|x3|1|2|3}} {{x3|1|2|3}}  
{{tlx|x4|1|2|3|4}} {{x4|1|2|3|4}} up to 3 parameters
{{tlx|x4|1|2|3|4}} {{x4|1|2|3|4}} | for more
{{tlx|x1|x=u}} {{x1}} = won't work
{{tlx|x1|x=u}} {{x1|x=u}} = is okay
{{tlx|x1|<nowiki>x=u</nowiki>}} {{x1|x=u}} sticky nowiki is okay
{{tlx|x2| |two}} {{x2|two}} empty won't work
{{tlx|x2|&#32;|two}} {{x2| |two}} &#32; is okay
{{tlx|x2|&nbsp;|two}} {{x2| |two}} &nbsp; is okay
{{tlx|x2| &#124; two}} {{x2| | two}} &#124; is okay
{{tlx|x2| {{!}} two}} {{x2| | two}} {{!}} is dubious
{{tlx|x2|2=|3=two}} {{x2|two}} empty really doesn't work
{{tlx|x2|2=one|two}} {{x2|two}} two clobbers 2=one
{{tlx|x2|3=two|2=one}} {{x2|one|two}} right to left okay


[edit] Comparison

As usual we have a zoo of similar templates, * marks redirects to {{tlx}}:
Usage Code Result
0 Tlx {{tlx|Tl}} {{tl}}
0 Tl {{tl|Tlx}} {{Tlx}}
1 Tlx {{tlx|Tlp|one}} {{tlp|one}}
1 Tlp {{tlp|Tlp|one}} {{Tlp|one}}
1 Tetl {{tetl|Tlp|one}} {{ Tlp|one }}
links talk view
2 Tlx {{tlx|Tl2|one|two}} {{tl2|one|two}}
2 Tlp2 * {{tlp2|Tlp|Tl|param}} {{tlp|Tl|param}}
2 Tl2 * {{tl2|Tlp|Tl|param}} {{Tlp|Tl|param}}
3 Tlx {{tlx|Tl3|1|2|3}} {{tl3|1|2|3}}
3 Tlp3 * {{tlp3|Tl3|1|2|3}} {{tl3|1|2|3}}
3 Tl3 * {{tl3|x3|1|2|3}} {{x3|1|2|3}}


[edit] See also

[edit] Discussion

Add issues below as you see fit, sign with ~~~~

[edit] Thin space

Using <small>&#160;</small> is a kludge, putting it mildly, but the proper &thinsp; is translated to UTF-8 by the server on the fly, and it doesn't work with old browsers. The code column in the example shows this effect - there is of course no such thing as a monospaced &thinsp;, neither emulated nor real.

Another trick used by {{[[Template:|]]}} is <tt>&#124;</tt> for the pipe symbol (vertical bar), a monospaced | adjacent to other text is better visible in the output for proportional fonts. I hope you like it, it's not ideal for text mode browsers. -- Omniplex 21:57, 24 March 2006 (UTC)

[edit] Space should not show up in copy/paste

The extra space between the braces and the name of the template seems like a problem to me. This template is showing up in the main lists of templates (WP:Templates). It is important that editors be able to copy and paste from these lists directly. The extra spaces mess this up. Some css code is needed to insert spacing, without inserting a character. If this "breaks" on older browsers such that the see output similar to {{tl}}, that's fine.--Srleffler 05:57, 11 July 2006 (UTC)

[edit] No spaces

I really don't see any need for them. They look hideous; they make the output take up much more space; they're inconsistent with {{tl}}; and they cause the output to break across lines. Λυδαcιτγ 04:03, 30 January 2007 (UTC)

[edit] Now virtually illegible in Safari


The template name is so small, and bold, as to be nearly unreadable in the Safari web browser (actually unreadable, for many people with poorer eyesight than I have). Please just make it look like {{tl}}. — SMcCandlish [talk] [contrib] 02:04, 6 February 2007 (UTC)

Thanks, that got it. — SMcCandlish [talk] [contrib] 15:35, 6 February 2007 (UTC)

[edit] Forcibly lower-casing initial letter looks very silly

Please fix this to stop enforcing lower-case initial letters. It looks silly and is confusing, e.g. {{wPBiography}}. "What's a PBiography?" — SMcCandlish [talk] [contrib] 15:04, 6 February 2007 (UTC)

Done. SgeoTC 02:40, 11 February 2007 (UTC)

[edit] Docs need updating, above

The "empty really doesn't work" and "empty really won't work" stuff is referring, from what I can tell, to tlx's own internal "2, 3" parameter logic, which I don't think is how most people use this template, so it's a bit confusing. As noted, "=" can be made to work with an escape, so empty does in fact work just fine, but only if you are using the target template's parms, not tlx's: {{WPBiography|living=yes|class=|importance=}}

I would suggest splitting the doc table into two tables, one about passing other template's parms to tlx, and one about tlx's internal "2, 3" parm logic.

Also, as the =-escaping hint suggests, effectively empty would work just fine with tlx's own parms, with "&nbsp;": {{tlx|x2|2=&nbsp;|3=two}} yields the intended {{x2| |two}} instead of the mangled {{x2|two}} in the documentation.

Hope that helps. — SMcCandlish [talk] [contrib] 15:35, 6 February 2007 (UTC)

[edit] tlx looks different than tl when you see them in a list

When you use both tlx and tl in a list they now produce noticeably different output - this looks fairly strange in places like Wikipedia:Image_copyright_tags/Free_licenses#Creative_Commons. —RP88 13:18, 27 February 2007 (UTC)

I agree with this, so I was bold and removed it. If anyone disagrees, feel free to revert and discuss (or even discuss first). GracenotesT § 05:02, 1 March 2007 (UTC)
They still seem to look different, which is bad. For example template:reqimage - Stevage 02:12, 27 March 2007 (UTC)
It is requested that an image or images be included in this article to improve its quality.
Please use {{reqphoto}}, {{reqmap}}, {{reqdiagram}}, or {{reqimageother|type of request}} instead of this template to clearly identify the type of image requested.