Template talk:Tlrow

From Wikipedia, the free encyclopedia

Contents

[edit] Documentation

{{Tlrow|template|up to 3 parameters}} is used in template lists, it creates a row (or begin of a row) for the specified template.

Parameter category= (empty string) is automatically set in the demo template call, it's conventionally used to suppress the addition of template lists to categories managed by the template in question.

[edit] Example

Code Result
{| border="1" cellpadding="3"
!''input''!!''output''
{{Tlrow|evd|0expr|2+3}}
{{Tlrow|tlx|0expr|2+3}}
|}
input output
{{evd}}
links talk edit
"{{0expr|2+3|}}" gives "05" [1]Template:Xpd/
{{tlx}}
links talk edit
{{0expr|2+3}}

The template isn't designed to support empty or named parameters. For such cases build the row manually, the 2nd coloumn is the actual template call, for the first column use {{tetl|template|up to 3 parameters}}.

[edit] Background

{{Tlrow}} is for the common simple cases in template lists, a left column with the syntax and internal links (talk, links, view), a right column with the example output as shown above. For these cases {{Tlrow|T|x|y|z}} is merely a shorthand for
|-
|{{tetl|T|x|y|z}}
|{{T|x|y|z}}
You can add more info below, continuing the right = result column. {{tetl}} is also a shorthand, it has the same effect as
{{tlx|T|x|y|z}}<br />{{lts/|T}}

{{tlrow}} skips the {{tetl}} step using {{Tlx}} and {{Lts/}} directly for some extra magic explained below. Likewise {{tetl}} skips {{tlx}} and {{Lts/}} for historical reasons, it belonged to a set of similar templates now all unified into {{tetl}} and {{tlsetl}}, the latter for templates requiring subst:.

At the core of this zoo were {{tlx}} and {{tlsp}} unifying similar templates, the latter again for templates requiring subst:.

[edit] Category magic

One obstacle with template lists are templates adding all pages where they are used to one or more categories. This can result in a huge number of bogus categories for template lists, corresponding to bogus entries of the list in the various categories.

A simple convention in the listed templates can avoid this, instead of
[[Category:somecat ]]
use
{{{category|[[Category:somecat ]]}}}

If the dummy parameter category is undefined the category works as before because it is the parameter default. If the parameter is defined and empty adding |category= to the template call bypasses the default, its output is an empty string.

{{Tlrow}} adopted this convention and adds |category= automatically in examples. If a template has its own ideas about parameter category you cannot use {{tlrow}}, just use the slightly more verbose {{tetl}} variant. If a template doesn't support this trick the unused named parameter causes no harm. See also WP:CT with many examples.

Some template lists add links to the categories populated by the listed templates. {{tlrow}} supports this with an optional parameter category=name. Because it uses this parameter anyway internally for the convention explained above it can use it for a different purpose in the left column, adding a category link [[Category:name|category]] in front of the other links (talk, links, view).

For consistent output on existing template lists it adds an additional empty line in this case, arguably that "feature" could be removed.

Please note that {{tetl}} doesn't support this magic to keep it simple and in line with {{tlsetl}}. If you can't use {{tlrow}}, e.g. for templates with named parameters, and want the output to be consistent, go directly to
|-
|{{tlx|T|x|y|z}}<br />{{lts/|T}}
|{{T|x|y|z}}
and add the category link in front of {{Lts/|T}}.

[edit] Subpages

Some template lists have to list pages outside of the template namespace, typically user or project subpages. {{tlrow}} and all other templates mentioned above don't support this at the moment. Use Template:Tlu (edit talk links history) where you'd write {{Tlx}} in the case of templates, its output is similar for up to three parameters.

Scope without subst: with subst:
template, no parameter Template:Tl (edit talk links history) Template:Tls (edit talk links history)
template, up to 3 parameters Template:Tlx (edit talk links history) Template:Tlsp (edit talk links history)
any page up to 3 parameters Template:Tlu (edit talk links history) Template:Tlsu (edit talk links history)
template list up to 3 parameters Template:Tetl (edit talk links history) Template:Tlsetl (edit talk links history)


[edit] See also

[edit] Discussion

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

[edit] Problems with images from commons.wikimedia and userspace userboxes

This template won't pull images from common.wikimedia.org -- for instance: Template:User Roman Catholic

{{User Roman Catholic}}
links talk edit
Template:User Roman Catholic

Banaticus 04:18, 6 October 2006 (UTC)

I believe this is actually a problem with the Tlx template. Banaticus 06:12, 6 October 2006 (UTC)

[edit] User Namespace template problem

How about adding a parameter that tells the template which namespace to use? For instance, I adopted a User Box. That user box was listed on a page with {{Tlrow}}. I updated the line listing the user box -- only to find that Tlrow doesn't work with templates in the User namespace. The new template would default such that the existing behaviour would be the default. Will (Talk - contribs) 04:48, 1 December 2006 (UTC)

[edit] Adding-current-page-to-category problem

Wikipedia:Userboxes/WikiProjects, etc., adds themselves to every category for which a category-adding userbox is listed, as a result of this template. Isn't there some way to short-circuit that? I don't know enough about the "esoterics" of WP templating to be sure. It kinda lame to have Wikipedia:Userboxes/WikiProjects show up in [[Category:WikiProject Foo members]]. — SMcCandlish [talk] [contrib] 06:29, 12 December 2006 (UTC)

[edit] Problems with default values for parameters ({{inappropriate person}})

It seems this template has a problem with the {{inappropriate person}} template as displayed in Template messages/Cleanup. It blanks out the default parameter value. --MooNFisH 10:55, 30 June 2007 (UTC)