Jump to content

Template talk:sort

Page contents not supported in other languages.
Add topic
From Wiktionary, the free dictionary
Latest comment: 1 day ago by Father of minus 2 in topic title gone

Doesn't work

[edit]

It doesn't seem to work when I subst it, I get the error: Lua error in Module:languages at line 405: The function getByCode expects a string as its first argument, but received nil.. On the other hand, it works fine when not substed. It should be the other way around of course, non-substed should give an error telling you to subst it. —Rua (mew) 19:59, 1 April 2019 (UTC)Reply

Whoops, it needed safesubst:. Now it works. — Eru·tuon 20:06, 1 April 2019 (UTC)Reply
Maybe, but {{x2i}}, {{x2ipa}}, {{x2rhymes}} don't throw an error and out of all of them there were just two examples of {{x2i}} in mainspace. (Though pretty old: I guess nobody has been checking.) — Eru·tuon 20:10, 1 April 2019 (UTC)Reply
It's not strictly necessary, but it's better to give an error whenever it's used wrong. That includes bad parameters, but also using a template without substing it if that is the intention. —Rua (mew) 20:11, 1 April 2019 (UTC)Reply
Makes sense. Done. I restricted the error to the main and Reconstruction namespaces, though. I figure it doesn't matter if it isn't substed in a userpage, for instance. Maybe Appendix should be included though? — Eru·tuon 21:19, 1 April 2019 (UTC)Reply
Preventing non-substitution has the advantage that you can change what it substitutes into at any time, without breaking existing uses. I don't see a particular need to restrict the check to particular namespaces, why would someone want to not substitute this anywhere? —Rua (mew) 21:34, 1 April 2019 (UTC)Reply
I guess you're right. It wouldn't be very useful not substituted, though {{x2i}} and the rest might. — Eru·tuon 21:45, 1 April 2019 (UTC)Reply

Doesn't handle templates

[edit]

See common#Derived terms. Sorts {{l}} items, before {{vern}} items, before what it is designed to handle: [[]] items and bare terms. DCDuring (talk) 01:38, 13 August 2024 (UTC)Reply

@Erutuon: I've noticed this too. Is there a way to have this (otherwise fantastic) template ignore templates like {{l}} and {{vern}} when sorting? — Sgconlaw (talk) 21:46, 4 October 2024 (UTC)Reply
@Sgconlaw: It would be non-trivial. The module doesn't see {{l|en|word}} when it's sorting; it sees <span class="Latn" lang="en">[[word#English|word]]</span>. So the module would have to generate the displayed text by parsing HTML tags and wikilinks (including category links) in the common cases you're mentioning. — Eru·tuon 17:12, 7 October 2024 (UTC)Reply
@Erutuon: gotcha. Oh well. — Sgconlaw (talk) 17:29, 7 October 2024 (UTC)Reply
@Sgconlaw: It's a good idea because this is a substituted template, though someone has to code it. {{col}} on the other hand probably shouldn't do a bunch of parsing because it isn't substituted and the extra processing could cause Lua performance problems. — Eru·tuon 17:44, 8 October 2024 (UTC)Reply
@Erutuon: something to add to your to-do list maybe, then! — Sgconlaw (talk) 17:51, 8 October 2024 (UTC)Reply

Hidden text

[edit]

I noticed that hidden text gets deleted when substing this template. Comments like <!--OED2 1989-->, for example. Denazz (talk) 09:01, 11 September 2024 (UTC)Reply

title gone

[edit]

also, the title= parameter gets deleted in the substing Father of minus 2 (talk) 07:59, 5 February 2025 (UTC)Reply