User:Chrisahn/Module talk:Params
Deleting this module
This section lists pages that still use Module:Params.
In addition to the ordering by namespace and alphabetic name, we could create sections by how the Params invocations could best be replaced, e.g. by a for-loop like {{For nowiki}}, by parameter-forwarding, or by some other technique. Based on this overview information, we should introduce some new modules (each about 20 to 50 times shorter than Params) to conveniently handle all cases.
Search for "invoke:params" in all namespaces
Here are all relevant current uses I found. Feel free to edit the list. — Chrisahn (talk) 16:19, 2 July 2026 (UTC)
Articles
Current tennis rankings-> Module:TEMPLATENAME * Pppery * in solidarity 16:47, 2 July 2026 (UTC)
Templates
Template:Autnum-> Module:Template wrapperTemplate:Autnum plain-> Module:Template wrapper * Pppery * in solidarity 17:00, 2 July 2026 (UTC)Template:Catlist-> Module:Template wrapper * Pppery * in solidarity 17:00, 2 July 2026 (UTC)Template:Error if empty- This should use Module:Template wrapper but that doesn't support shifting positional parameters. Not sure if there's a true-variadic way of doing this with existing modules. * Pppery * in solidarity 17:00, 2 July 2026 (UTC)
- Module:Template wrapper positional didn't quite do what was wanted here anyway. In the end I decided no pages used the template variadically so just reduced this to a two-parameter template with no module calls. * Pppery * in solidarity 23:51, 2 July 2026 (UTC)
Template:Etymology-> Module:For batched parameters- reverted to old code, can't find any existing modules that handle positional parameters in groups of threes * Pppery * in solidarity 17:04, 2 July 2026 (UTC)
Template:Internal link with parameters-> Module:For each named parameter- This basically can't be done without writing a custom lua module for it; taking arbitrary names parameters and concatenating them doesn't match any other modules I can think of. * Pppery * in solidarity 17:05, 2 July 2026 (UTC)
Template:IPA double slash-> Module:Template wrapper positional- This should use Module:Template wrapper but Module:Template wrapper has opinions about positional parameters which this case doesn't share. This does have old code to revert to. * Pppery * in solidarity 17:08, 2 July 2026 (UTC)
Template:Link with archives- Sent to TfD. This could use Module:For nowiki in any event without too much difficulty * Pppery * in solidarity 17:11, 2 July 2026 (UTC)
Template:Magic word link-> Module:For nowiki, Module:For each named parameter * Pppery * in solidarity 23:51, 2 July 2026 (UTC)- Needs arbitrary-named-parameter concatenation, like Template:Internal link with parameters. * Pppery * in solidarity 18:42, 2 July 2026 (UTC)
Template:MOS-TRANS– Reverted to old code, but should be converted to a for-loop that handles parameter names that contain numbers, a bit like Module:ArgRest- We later decided that we didn't need a funky module here since the functionality in question wasn't even used * Pppery * in solidarity 21:44, 2 July 2026 (UTC)
Template:Numbered verses- Reverted to old code based on Module:String by Primefac. This wasn't about params at all per se, but instead was doing some string replacements so there's no real new concept here * Pppery * in solidarity 21:44, 2 July 2026 (UTC)Template:Pantone table – Done, converted to for-loopsTemplate:Preload–> Module:For nowiki * Pppery * in solidarity 18:05, 2 July 2026 (UTC)Template:ProdwarningLLM-batch-> Module:For nowikiTemplate:Quantitative metre-> Module:For nowiki and Module:MultiReplace * Pppery * in solidarity 19:11, 2 July 2026 (UTC)Template:Remoteref-> Module:Template wrapperTemplate:Ruby line-> Module:For nowiki. Doesn't work quite the same way but should be close enough. * Pppery * in solidarity 17:44, 2 July 2026 (UTC)Template:Show SVG-> removed the params code entirely as it was only allowing substitution and I don't see why one would want to do that * Pppery * in solidarity 17:28, 2 July 2026 (UTC)Template:Standard installation- replaced with standard wikitext. * Pppery * in solidarity 17:31, 2 July 2026 (UTC)Template:Wrapper – Done, reverted to old code(see discussion below)Wikipedia:Reliable sources/Perennial sources/Uses – Done, converted to for-loop
Template sandboxes
- Template:Db-nonsense-notice/sandbox
- Template:Db-test-notice/sandbox
- Looks like these two could be converted to Module:Template wrapper fairly easily. * Pppery * in solidarity 18:22, 2 July 2026 (UTC)
- Template:Enum/sandbox
- Discussion at Template talk:Enum#Optional serial comma basically concluded that Module:Separated entries can do this sufficiently as is. * Pppery * in solidarity 18:22, 2 July 2026 (UTC)
- Template:Infobox network service provider/sandbox – Reverted to old code, but should be converted to a for-loop, Module:ArgRest should work
- Template:Sfnlink/sandbox
- This doesn't have any new concepts not covered by #Discussion below, and looks like it could have been a fairly straightforward Module:For nowiki case. The implementation would be a bit awkward, but since Primefac reverted to old code it should work. * Pppery * in solidarity 20:15, 2 July 2026 (UTC)
- Template:Wrapper/sandbox
- See below
- Template:Infobox settlement/mergedmap
- Template:Infobox settlement/mergedmap1
- These two look like another instance of what I call "missing concept 4" below. Since these are just sandboxes I still won't actually build missing concept 4. * Pppery * in solidarity 20:09, 2 July 2026 (UTC)
User pages
Low priority, but there may be some interesting uses of Params that might provide inspiration for new modules. I omitted pages that had "sandbox" or "archive" in their name or path.
- User:BrandonXLF/Help:Infinite parameters/basic
- Orphan user subpage, seems to be a demo of various ways of doing infinite params so doesn't inspire any new concepts. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:BrandonXLF/Help:Infinite parameters/prefix
- Ditto. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Cadddr/u2d
- No idea what this is, seems to be a broken test. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Grufo/Debug
- Cool idea, but covered sufficiently by Module:Template invocation and/or Module:Arbitrary named parameters. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Grufo/Templates/Watch list
- This does introduce one new concept (let's call it "missing concept 5": sorting the output by something before parsing. Since this is only in a userspace sandbox I'm fine not implementing it)
- User:SkSlick/templates/Titled Except
- Hard to parse without documentation of any kind but this looks like it could be done with Module:For nowiki. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Thatgaypigeon/Babel
- This wraps {{for nowiki}}, seemingly not knowing that {{#invoke:For nowiki|template}} exists. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Thatgaypigeon/TemplateData param
- User:Thatgaypigeon/TemplateData param/array
- User:Thatgaypigeon/TemplateData params
- This and its various bits are so complicated I have no hope of understanding what it is trying to do especially with no documentation. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Thatgaypigeon/Userbox
- Could probably be done with Module:Template wrapper
- User:Thatgaypigeon/Userbox gallery
- User:Thatgaypigeon/Userbox gallery item
- This and its various bits are so complicated I have no hope of understanding what they are trying to do especially with documentation. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Thatgaypigeon/Userbox wrapper
- Looks like it could use Module:Arbitrary named parameters
- User:Thatgaypigeon/Userboxes/Arc
- Not sure what Module:Params is doing here, why not use a normal userbox? * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Tpolr esh/sandbox
- Looks like a slightly more complicated version of Template;Numbered verses. Would be a pain to rewrite or understand so I don't care. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Your Friendly Neighborhood Sociologist/Template:Regional articles
- This looks like it could use Module:ArgRest * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- User:Your Friendly Neighborhood Sociologist/Template:Regional articles/row
- This just counts the number of parameters. I don't think we have a module for that, but it could be done fairly straightforwardly with just wikitext especially since other parts of this template aren't variadic. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
- There's Module:ParameterCount. I'm not sure whether it produces the same result as {{#invoke:params|sequential|count}} in all cases (named parameters, numbered parameters with gaps...), but it should be close enough. Anyway, it's a user page, low prio. — Chrisahn (talk) 00:58, 3 July 2026 (UTC)
- This just counts the number of parameters. I don't think we have a module for that, but it could be done fairly straightforwardly with just wikitext especially since other parts of this template aren't variadic. * Pppery * in solidarity 20:30, 2 July 2026 (UTC)
Discussion
So, focusing only on "articles" and "templates", we have:
- Module:TEMPLATENAME (7 lines of code, Current tennis rankings)
- Module:Template wrapper (284 lines of code, Template:Autnum/Template:Autnum plain/Template:Catlist/Template:Remoteref)
- <missing concept 1: a version of Module:Template wrapper that handles positional params better> (Template:Error if empty, Template:IPA double slash)
- Module:For nowiki (46 lines of code, Template:Link with archives, Template:Preload, Template:ProdwarningLLM-batch,Template:Pantone table,Wikipedia:Reliable sources/Perennial sources/Uses, Template:Ruby line, Template:Quantitative metre)
- <missing concept 2: paired parameters> (Template:Etymology)
- <missing concept 3: arbitrary named parameters following no pattern> (Template:Internal link with parameters, Template:Magic word link)
- <missing concept 4: like Module:ArgRest, but pass the output to a template instead of concatenating it> (Template:MOS-TRANS)
- I think this is the scenario that the second bullet point of Module:ArgRest#Helpful templates is trying to cover, but yuck.
- removed params code entirely and replaced it with no module at all (Template:Show SVG, Template:Standard installation)
- Still to do: Template:Numbered verses, Template:Wrapper (the revert to old code here just clobbered a lot of preexisting functionality)
* Pppery * in solidarity 18:17, 2 July 2026 (UTC)
- Wrote out a draft for how missing concept 3 would work as Module:Arbitrary named parameters (probably should have a better name), which is 15 lines of code. Not going to deploy it to any templates until Chrisahn or someone else confirms the idea makes sense. * Pppery * in solidarity 18:57, 2 July 2026 (UTC)
- I'm not going to pursue missing concept 4 because the only use ended up not being used anywhere itself. * Pppery * in solidarity 18:58, 2 July 2026 (UTC)
- Great! Makes perfect sense. A few suggestions:
- Should we call the module
for named parameters, or maybeforeach named parameter? It's a foreach loop, and it's similar to {{For nowiki}} and {{For loop}}. - Maybe the
codeparameter could be unnamed, as in {{For nowiki}}. But that's a matter of taste. - I guess there should be a way to exclude certain parameters. For example, {{Internal link with parameters}} has a
classparameter that should not be included in the URL. (Although the current code doesn't handle this, and it's a design flaw anyway: What if I want to have aclassparameter in the URL, but I don't want to change the CSS class of my table? The template parameter should be renamed to#classor something else that it very unlikely to occur in a URL.)
- Should we call the module
- Chrisahn (talk) 19:32, 2 July 2026 (UTC)
- You can exclude named parameters by an if statement based on the name passed to the nowiki-ed code. Although the code as I wrote it did a duplicate separator when you did that, which wasn't ideal, so I fixed that by omitting the separator of the nowiki-ed code returns the empty string. * Pppery * in solidarity 19:37, 2 July 2026 (UTC)
- Makes sense. I added another example. If Module:For each named parameter has lots of users one day and many of them want to exclude parameters from processing, we can always add an option to do that without having to write
{{#ifeq:{{{name}}}|foo||...}}. But it's fine for now. — Chrisahn (talk) 01:06, 3 July 2026 (UTC)
- Makes sense. I added another example. If Module:For each named parameter has lots of users one day and many of them want to exclude parameters from processing, we can always add an option to do that without having to write
- You can exclude named parameters by an if statement based on the name passed to the nowiki-ed code. Although the code as I wrote it did a duplicate separator when you did that, which wasn't ideal, so I fixed that by omitting the separator of the nowiki-ed code returns the empty string. * Pppery * in solidarity 19:37, 2 July 2026 (UTC)
- Great! Makes perfect sense. A few suggestions:
- Regarding paired parameters (or rather, grouped parameters): We could extend Module:For nowiki with a
stepparameter. In the case of Template:Etymology, which processes parameters in groups of three, we'd setstep=3, and thenowikicode block would be executed with three parameters instead of one: First with parameters 1 through 3, then with 4 through 6, etc. - We'd have to come up with a syntax for the additional parameters. Currently, Module:For nowiki only handles
{{{i}}}and{{{1}}}in thenowikicode block. The obvious choice is to also handle{{{2}}},{{{3}}}, etc. - What should
{{{i}}}contain? The current index of the first parameter (i.e. 1, 4, 7, ...) or the index of the current group (i.e. 1, 2, 3)? - Also, maybe it would be better to create a new module for this, lest we turn Module:For nowiki into another kitchen sink module. :-)
- — Chrisahn (talk) 19:00, 2 July 2026 (UTC)
- Of course, this
stepparameter isn't a new idea. Module:For loop has abyparameter. It's similar to thestepI suggested, but it's only used in the mode when the module just iterates over numbers, not over parameters. I guess it could be extended to also apply to the parameter mode. (I findstepclearer thanby, but that's a matter of taste.) There are similar features in Ruby (each_slice), Python (batched), PHP (array_chunk). — Chrisahn (talk) 19:11, 2 July 2026 (UTC)
- Of course, this
- Wrote up missing concept 1 as Module:Template wrapper positional. * Pppery * in solidarity 19:37, 2 July 2026 (UTC)
- Wrote up missing concept 2 as Module:For batched parameters. * Pppery * in solidarity 20:06, 2 July 2026 (UTC)
- Re Template:Wrapper I just accepted Primefac's revert - the parameters use was extremely complicated (multiple separate calls with substacks), and in most cases it was ultimately producing info already stated elsewhere in the doc, or tech details that weren't really needed to understand that template at all. So I'm not reimplementing that one at all. It also had more to do with string processing than it did with parameters per se. * Pppery * in solidarity 21:26, 2 July 2026 (UTC)
- I agree. Also, I saw the output of that complex Params code in some templates that use {{Template wrapper}}, and I found it hard to understand: Parameters were said to be "managed" or to "work here", but there were "exceptions"... I guess we could have fixed these wording problems, but I don't think it's worth the effort. If a template doc page wants to inform its users which parameters are passed through or not, it's probably best if that's written by a human. — Chrisahn (talk) 22:32, 2 July 2026 (UTC)
- Okay, I've converted the remaining two templates. I think we're done here. * Pppery * in solidarity 00:15, 3 July 2026 (UTC)
- @BrandonXLF had some interesting ideas regarding named parameters that are also indexed, e.g.
foo_1. As Brandon said, probably too much for Module:For nowiki, but interesting anyway. — Chrisahn (talk) 09:42, 3 July 2026 (UTC)- That's exactly what Module:ArgRest does? * Pppery * in solidarity 14:00, 3 July 2026 (UTC)
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.