Template talk:Tlx

From Wikipedia, the free encyclopedia

Template:Tlx is permanently protected from editing, as it is a heavily used or visible template.

Substantial changes should be proposed here, and made by administrators if the proposal is uncontroversial, or has been discussed and is supported by consensus. Use {{editprotected}} to attract the attention of an administrator in such cases.
Any contributor may edit the template's documentation to add usage notes, categories or interwiki links.

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. Its purpose is to make well-formatted links to pages easier to type.

[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

Resolved. Requested edits made.

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

Resolved. Requested edits made.

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

Resolved. Requested edits made.

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

Resolved. Requested edit made.

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)

{{editprotected}} Automatic lower-casing of the first letter of the template name seems to be happening again. I typed in

  • {{tlx|Resolved|''note''}}

but get the display:

  • {{resolved|''note''}}

Can that be fixed? Thanks! Libcub (talk) 05:37, 3 March 2008 (UTC)

The original change fixed the template to enforce lower-case initial letters if and only if all the other letters of the template name were lowercase; this seems to have been deliberate. Do you think that the template should be changed to preserve the case of all letters in all circumstances instead? --ais523 19:26, 10 March 2008 (UTC)
I think so. I would like to be able to control how the text displays. I don't see other templates doing this sort of thing. Is there some advantage I'm missing? Libcub (talk) 20:07, 10 March 2008 (UTC)
Y Done. —Random832 20:28, 10 March 2008 (UTC)

[edit] Docs need updating, above

Unresolved. Someone actually needs to do this, probably the nominator.

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 together

Resolved. Rescinded by nominator.

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.
This still isn't resolved, after months and months. Please copy the formatting (CSS and such) from {{tl}} into {{tlx}} so that they have a mutually consistent appearance (or vice versa; an argument can certainly be made that the monospaced font helps distinguish between otherwise similar-looking characters (in some fonts), like 1, l and |, or 0 and O). The only difference between these templates should be tlx's handling of additional parameters. Some samples to compare (bigger than those in the Reqimage sample template above: {{reqdiagram}} vs. {{reqimageother|type of request}}
Also, while we're at it, this template should have a permprot template on it (don't care which one; the little top-right lock icon is fine). — SMcCandlish [talk] [cont] ‹(-¿-)› 16:19, 27 September 2007 (UTC)
I'm not there's consensus for this change. Template:Tlx has used a monospace font for the past seven months.... --MZMcBride 00:29, 28 September 2007 (UTC)
N Not done This change requires more consensus before it's appropriate for an admin to do it immediately; maybe you could start a discussion about it somewhere like WP:VPR? --ais523 16:46, 28 September 2007 (UTC)
I'm skeptical there was ever consensus to change it in the first place; I remember a time when {{tl}} and {{tlx}} looked identical as to their output formatting. But rather than fight about this, I suggest a code fork, {{tlx}} and {{tlxcode}}, with the latter being monospaced, since the only reason to have it look that way is when giving code examples. It would probably be wise to do this in a metatemplated fashion so that all code other than this difference is transcluded, and that way the two versions stay 100% in synch at all times. — SMcCandlish [talk] [cont] ‹(-¿-)› 18:47, 27 November 2007 (UTC)
Rescinded. One can use {{tlx}} as if it were {{tl}} when ones wants to use both side by side and have them be consistent with each other; and there really isn't any reason to use {{tlx}} at all unless giving code examples, so my objection didn't make much sense. — SMcCandlish [talk] [cont] ‹(-¿-)› 09:49, 29 November 2007 (UTC)

[edit] Needs more parameters

Resolved. Compromise version arrived at.

{{Editprotected}}
Adding more parameters to this is pretty much just a copy-paste job. It needs to support at least 25, and there are probably instances needing more, though I'm not personally aware of any. A good example of where more parameters are needed: Template:CompactTOC8/doc. — SMcCandlish [talk] [cont] ‹(-¿-)› 18:42, 27 November 2007 (UTC)

There are size limits - for those rare cases why not just do the markup by hand? (leaving template in case someone more knowledgeable than me thinks this will work well).—Random832 01:47, 29 November 2007 (UTC)

Well, of course there are size limits. I didn't say it needs 100 parameters. :-) Why not do it by hand? It's a pain in the neck, esp. if you need to illustrate 10 different complicated uses of a multip-field template. The entire point of {{tlx}} is that is it useful for very quickly illustrating the use of complex templates, so it is defeating itself by having so few fields. The case mentioned is only one of many; this too-small limitation of {{tlx}} bites me in the soft bits about 3x a week. — SMcCandlish [talk] [cont] ‹(-¿-)› 09:46, 29 November 2007 (UTC)
I'll increase the capability of this template to 10 parameters (that is, the template will have 11 parameters, since the first is devoted to the example template's name), but beyond that (as an arbitrary limit, rather than a reasoned one) it seems ridiculous, especially considering that templates with so many parameters are usually laid out vertically, and {{tlx}} does not support vertical layout. If you want a template for displaying the syntax of templates with more than 10 parameters, they should probably should be laid out vertically for the sake of readability. After upgrading this template, I'll check if such a template exists - if not, I will create it. Nihiltres{t.l} 15:29, 29 November 2007 (UTC)
Y Done - As per my comment. Nihiltres{t.l} 15:41, 29 November 2007 (UTC)
If the need ever does arise, create a separate template like {{tlxtra}} to handle templates with more than 10 parameters, so this one doesn't have to do a bunch of unnecessary #if's. –Pomte 16:28, 20 January 2008 (UTC)

[edit] Help

I need help editing this template and a few others at [1] --MahaPanta (talk) 02:30, 25 December 2007 (UTC)

[edit] Simple explanation needed

Could someone please explain in plain English at the top of the documentation what this template is for? The current explanation baffles me. Thanks. --Dweller (talk) 10:14, 22 February 2008 (UTC)