Template talk:T

From Valve Developer Community
Jump to: navigation, search

A lot of same templates and an extra limits

A long time ago I tried to rework the {{Tl}} template to make it simple and easy to use, but it didn’t catch on and was marked as obsolete.

After that I found out that there are other versions of this template:

  • {{Tl}} – template that is marked as obsolete.
  • {{Tl2}} – the main template that is used on most pages.
  • {{Tla}} – the same as {{Tl2}}, but it’s possible to specify other text to display instead of the template name, which I think is kind of unnecessary because I can do something along the lines of a deceptive link like {{Link to Template:Delete}}.
  • {{Tlb}} – the same as {{Tl2}}, but in bold.
  • {{Tlc}} – the same as {{Tl2}}, but without a link and with more parameters (which is bad. I wrote about this in more detail a little later in this message).
  • {{Template link with linked braces}} ({{Tn}}) – the same as {{Tl2}}, but the link includes internal parentheses (There is absolutely no use in this at all).
  • {{Template link general}} ({{Tlg}}) – A kind of root template for use in most other templates of this type.

There are so many of them that my head started to hurt when I tried to figure out what was what. I will simply add the remaining templates that I found without description (Sorry, but it really hurts me to understand each template when the differences in them are almost invisible):

(These are just the templates that I could find. Perhaps there are even more of them.)

The {{Tl2}} template (as main one) contains several parameters that are not used in any way on this wiki, because it is not structured the same as on Wikipedia. The template also has additional limitation in the form of the ability to specify only two displayed unnamed parameters. I know that you can use = (equal symbol) to imitate a named parameter, but this does not change the fact that you can only display two parameters. You can also say that if you need more, you can simply add more parameters to the template code: {{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{n|}}}. However, this approach complicates the template and makes it harder to process.

I suggest to make this redirect into a final and fully developed template without all the extra stuff.

I have already redesigned this redirect template (I won’t publish it yet) and was able to avoid all the problems I listed.

The best and easiest way to avoid the limit of displayed parameters was to use a different template to display the parameters (this is the {{P}} template that I just published). Thus, this reduces the load, since the template does not have more than one parameter to display all parameters.

Several examples of how the new version of the template will work:

  • {{T|Test}}{{Test}}
  • {{T||Test}}{{Test}}
  • {{T|Test|{{P|Some Text}}}}{{Test|Some Text}}
  • {{T|Test|{{P|param|10}}}}{{Test|param=10}}
  • {{T|Test|{{P|param|10}}{{P|header|}}{{P|data|hello}}}}{{Test|param=10|header=|data=hello}}

You may say that the new way of using it is too cluttered, but I looked at a lot of pages that use the Tl and Tl2 templates and very rarely saw that any parameters were added to them when using them. In any case, this method of use is more useful for template documentation pages, instead of constantly using the <nowiki> tag.

Please write what you think about all this. Right now I will be looking at all the pages that use this redirect template so that I can immediately know which pages to correct for the new template format. --Max34 (talk) 11:52, 19 June 2024 (PDT)

I looked through a lot of pages (I started looking at them long before I wrote the previous comment). I’ll implement my new code. You can undo it if it is too early to do so. --Max34 (talk) 12:51, 19 June 2024 (PDT)