Loading AI tools
From Wikipedia, the free encyclopedia
![]() | To help centralise discussions and keep related topics together, the talk pages of all templates directly invoking Module:Template link general redirect here. |
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
![]() | Text and/or other creative content from this version of Template:Tlg was copied or moved into incubator:Template:Wp/nod/tlg with this edit. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
|
|
The latest implementation of this template leaves trailing pipe symbols if a parameter is left empty. For example:
{{tnull|wd|label|}}
→ {{wd|label|}}
This used not to be the case. I'm having optional parameters (depending on where the page is transcluded) which are therefore sometimes left empty, so ideally the trailing pipe would not be printed in that case. Could someone perhaps improve this (Artoria2e5 or Primefac maybe)? Thanks. Thayts ••• 22:28, 21 December 2020 (UTC)
...can be used as {{fnh|surname|pen name}}and have it show up as {{fnh|surname|pen name}}, because those two inputs would give completely different outputs. Primefac (talk) 14:04, 22 December 2020 (UTC)
local textPart = ""
local textPartBuffer = ""
local i = 2
while args[i] do
local val = args[i]
if val ~= nil then val = mw.text.unstripNoWiki(val) else break end
textPartBuffer = textPartBuffer .. '|'
if val ~= "" then
if _ne(args.nowiki) then val = nw(val) end
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
textPart = textPart .. textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
end
val = mw.text.unstripNoWiki(val)
local val = mw.text.trim(mw.text.unstripNoWiki(args[i]))
(also trimming away spaces that might be in between the nowiki tags). Thayts ••• 12:20, 14 February 2021 (UTC)
{{tlx|draft categories|<nowiki>1=[[Category:first category]][[Category:second category]]</nowiki>}}
does not work as expected. The "categories" are rendered as actual, active categories. For an example, see the bottom section of this revision. davidwr/(talk)/(contribs) 🎄 14:18, 21 December 2020 (UTC)
As someone who has dealt with simple html and other coding to only a limited extent over the years, I'm none the much wiser after reading the article. It would be great if some guidance on, for example, situations in which tlx is used, what it does in a nutahell, could be added. Clearly I'm not the one to do it, though. Sorry... Cheers, Simon – SCHolar44 🇦🇺 💬 at 03:56, 26 January 2021 (UTC)
used to provide stylized formatting to template displays without actually using the template itselfsound better? Primefac (talk) 01:17, 27 January 2021 (UTC)
![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Add {{{|safesubst:}}}
just before the #invoke so the template can be substituted cleanly. JsfasdF252 (talk) 17:54, 20 February 2021 (UTC)
It would be helpful if {{tls}} outputs something like this: {{subst:tls}} rather than this: {{subst:tls}}. Can the module be modified to handle this? JsfasdF252 (talk) 01:32, 24 February 2021 (UTC)
@Somerandomuser: A recent edit to Help:Displaying a formula changed {{tl}} to {{tlx}} with no parameters. Is that a legitimate use of {{tlx}}? IAC,the introduction to Template:Template link expanded should provide guidance as to whether it is appropriate to use {{tlx}} with no parameters. Shmuel (Seymour J.) Metz Username:Chatul (talk) 14:06, 8 March 2021 (UTC)
{{tlx}}
, which is entirely a stylistic choice. Primefac (talk) 14:16, 8 March 2021 (UTC)
|code=yes
when you want to make the text appear in a <code>...</code>
block. Second, I didn't change anything (I am not Somerandomuser). Third, there isn't a clearly-defined use case on the documentation because there aren't clearly-defined times when specific templates should be used. Personally, I find using {{t}} or similar much faster if I'm just putting the template in conversation like this one, and if I want to emphasize something I'll chuck it into {{tlx}} so that it "pops" (just like I did with the |code=
param above).For some reason, <nowiki>
quit working inside parameter input with this and related templates for a while (I think I encountered this about 24 to 36 hours ago):
{{tlx|foo|bar|baz{{=}}<nowiki>[[Quux]]</nowiki>}}
produced output that looked like:
instead of:
{{foo|bar|baz=[[Quux]]}}
My immediate suspicion is that it had something to do with the TfD-related tagging (and dispute about that) around that time period, under discussion here and here. Whatever caused it should be identified, and we should see if there's a way to prevent that in the future, since it (temporarily) corrupted a whole lot of template documentation into gibberish (and worse, like completely incorrect descriptions of parameter usage and behavior). — SMcCandlish ☏ ¢ 😼 23:21, 23 March 2021 (UTC)
[[Template:{{{1}}}|{{{1}}}]]
to stop working, except for maybe it could be a parser issue with the extra code added on causing an overload, but that usually affects transclusions not tags. Plus, we've had "well-used" templates get tagged before and it has not adversely affected them. Server-side glitch? Primefac (talk) 23:32, 23 March 2021 (UTC){{tlx|foo|bar|baz=[[quux]]|nowiki}yes}}
(producing {{foo|bar|baz=[[quux]]}}
, but I agree that how to format parameters should be none of this template's business. * Pppery * it has begun... 03:09, 24 March 2021 (UTC)![]() | This edit request to Module:Template link general has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please implement the above sandboxed code to address this bug. * Pppery * it has begun... 20:32, 24 April 2021 (UTC)
I've modified the /sandbox to enable the module to additionally show the output of the code when using |_show_result=
.
I've tested the above scenarios which work. Gonnym (talk) 14:42, 15 January 2022 (UTC)
|_show_result=
instead of |show_result=
for the very rare case of the template itself having a parameter with that name. Gonnym (talk) 15:09, 15 January 2022 (UTC)
![]() | This edit request to Module:Template link general has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Per the above discussion, please copy the version in the sandbox. Gonnym (talk) 17:54, 28 January 2022 (UTC)
Gonnym, just came across a case where if you put a named parameter in the middle of unnamed parameters, it messes with the order of the unnamed parameters (note the older version has three "Charles Darwin" links instead of language links in the #Piping links section). Is this an edge case or something that should probably be looked at? Primefac (talk) 10:34, 2 March 2022 (UTC)
{{ill|Charles Darwin (botanist)|text=Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin}}
→ Charles Darwin (botanist)|_expand=
which adds an expand template link. See examples:
Both |plaincode=
and |kbd=
produce the same result visually but kbd is not very good semantically. Shouldn't it be discouraged from using? Tran Xuan Hoa (talk) 12:00, 21 April 2023 (UTC)
kbd
is the name of the tag itself. Primefac (talk) 13:56, 21 April 2023 (UTC)
{{Example|param1=val1|param2=val2}}
inside <kbd>...</kbd>
is correct usage. Perhaps it is acceptable to count template code as keyboard input(?) Tran Xuan Hoa (talk) 16:07, 21 April 2023 (UTC)
![]() | This edit request to Template:Template link with parameters has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hi. This template makes infinitely large columns, and this is visible especially in tables. Would it be possible to add the <wbr />
tag before each |argument
(i.e. <wbr />|argument
)?
Currently {{tlnp}} uses <wbr />
, and you can compare the two behaviours when the two templates are transcluded in a confined space.
{{tlp}}:
{{tlnp}}:
Grufo (talk) 15:11, 17 July 2023 (UTC)
|nowrap=yes
in its code, so it seems counterproductive (or possibly not functional) to override that option by inserting wbr tags. I don't know why |nowrap=yes
is in there, but you might look in the discussion archives or the edit history for the reason. – Jonesey95 (talk) 22:03, 17 July 2023 (UTC)
|nowrap=yes
, I am asking to make the template wrappable when people do not specify |nowrap=yes
. Right now it seems that even if I don't specify |nowrap=yes
the template behaves as if I did (look at my example above). Please link to a page where this is a problem: Just to mention one case, there was a problem in the documentation of this very template before I fixed it by removing the {{tlx}} template and I replaced it with {{tji}} (compare some of the tables in the two versions). --Grufo (talk) 23:04, 17 July 2023 (UTC)
Can you please be more specific about which line of the table was not rendering well?: Sure. From line 69 to line 106 in both versions (both before and after my edits). But this is just the tip of the iceberg and I have encountered this problem several times; the very reason why both templates {{tji}} and {{tlnp}} do have the
<wbr />
tag in their code is exactly to avoid the weird behavior of {{tlx}} – the same reason that ultimately brought me here. --Grufo (talk) 01:20, 18 July 2023 (UTC)
{{Template link with subst}} has quite a few shortcuts: {{tls}}, {{tlsp}}, {{tlps}}; would you mind leaving one for {{Template link with sorted parameters}}? I see that the {{tlps}} shortcut is not advertised and is currently used by only a hundred pages. Maybe that could be the one? Or if you have another name to suggest, I would be more than happy avoiding to edit 100 pages. --Grufo (talk) 18:41, 17 July 2023 (UTC)
If they want things in the "right" order they'll just type them in that order. In that case (i.e. if they themselves use the right order), they should definitely use the {{tlap}} template, because then they won't have to escape the equals sign. Compare writing
Template:Template link general/doc#Examples documents that this template and its derivatives ignore empty parameters. Why is this? I was brought here because I fixed some documentation written by another user which presented incorrect information because the author did not anticipate this behavior. I'm trying to understand if this is a bug or a feature. Daask (talk) 19:08, 13 October 2023 (UTC)
Had a thought about directly supporting named parameters instead of requiring the workaround of named
. What would it look like if we supported parameters {{=}}
a=named1, b=named2, c=named3... z=named26
that would display as {{templatename|named1=|unnamed1|unamed2|named4=|unamed3}}
where the named parameters have an explicit place in the order of the parameters and the unnamed parameters fill in any holes. You could even contrast upper and lower case for named parameter explanations, so
would show up as {{tlp|templatename|a=named1|A=explanation1}}
{{templatename|named1=explanation1}}
. Any thoughts or concerns? VanIsaac, GHTV contWpWS 18:35, 6 December 2023 (UTC)
{{tlx|templatename|a=weasel=yes|b=snorkel=|c=3=23%}}
to get display that looks like {{templatename|weasel=yes|snorkel=|3=23%}}
. But this is kind of pointless when you can already do:
{{tlx|templatename|2=weasel=yes|3=snorkel=|4=3=23%}}
for {{templatename|weasel=yes|snorkel=|3=23%}}
.{{tlx|templatename|weasel{{=}}yes|snorkel{{=}}|3{{=}}23%}}
for identical {{templatename|weasel=yes|snorkel=|3=23%}}
output{{tlx|templatename|<nowiki>weasel=yes|snorkel=|3=23%</nowiki>}}
for the same result {{templatename|weasel=yes|snorkel=|3=23%}}
The {{tlc}}
and {{tlx}}
templates' features seem to have become almost entirely redundant with each other over time, and these two templates should probably be merged. — SMcCandlish ☏ ¢ 😼 23:51, 24 December 2023 (UTC)
{{tlx}}
vs unlinked {{tlc}}
. Primefac (talk) 00:32, 25 December 2023 (UTC)
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.