Jump to content

Template talk:Infobox Australian place/Archive 10

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 5Archive 8Archive 9Archive 10

Module (Lua) version of the template

There is now a Lua version of the template. The Module (lua) code is at Module:Sandbox/Innesw/Infobox Australian place, the template to call to test the module is {{Sandbox/Innesw/Infobox Australian place|<infobox parameters>}}.

Such a significant proposed change to a protected template obviously needs not only thorough testing of the output, but a careful independent review of the code. Therefore I don't think the template sandbox is the right place to put this yet.

Please test it for all possibilities, and put comments and (especially negative) test results either here or on the module talk page.

There are some changes in the lua version's output:

Old Behaviour New Behaviour
for a non-numeric value for |pop= a population density calculation was attempted, and produced an error a non-numeric |pop= value means a population density is not calculated (and therefore not shown)
some tracking categories were output in all namespaces, ie: where
  • |pop= is given but no |pop_year= or |pop_footnotes=
  • |pop2= is given but no |pop2_year= or |pop2_footnotes=
  • |pop is non-numeric (which causes density errors)
except in article namespace, output of all categories is suppressed (all the 'automatic' categories, and all the tracking categories)
there is a colon at the end of the heading for the 'Places Near' sub-table colon not output

I have tested the output of each of the individual cases on the testcases page (a process which fixed some issues) and I believe the module now produces the same visual results in all these cases (except for the above changes).

There are a considerable number of calls to expand other templates (lframe:expandTemplate{...}), a number I would like to reduce if module equivalents exist. Suggestions welcome.

I would hope that transferring the template code to lua will make changes to the template easier - just by getting away from the obtuse syntax of templates. Innesw (talk) 09:40, 25 March 2024 (UTC)

You should bring this to the attention of readers at Wikipedia talk:WikiProject Australian places, Wikipedia:Australian Wikipedians' notice board, Wikipedia talk:Australian Wikipedians' notice board. BTW, the template to test the LUA code is {{Sandbox/Innesw/Infobox Australian place}} (that didn't come across in your message). Template:Sandbox/Innesw/Infobox Australian place/testcases seems to be missing so far. -- Michael Bednarek (talk) 11:21, 25 March 2024 (UTC)
I was intending to work my way up the hierarchy with announcements, seeing what responses there were as I went. I can copy Template:Infobox Australian place/testcases if you think that's the best way to go, but I have checked all the cases that are there. I'm not sure what the method would be for wider testing, if that's reckoned necessary. Innesw (talk) 22:05, 25 March 2024 (UTC)
You asked for thorough testing, and that needs testcases. The current Template:Infobox Australian place/testcases is already very extensive, so a new one seems to be called for. -- Michael Bednarek (talk) 02:23, 26 March 2024 (UTC)

Michael has asked for more testcases to add to what he says is the 'already very extensive' set in Template:Infobox Australian place/testcases. I admit I was remiss in asking vaguely for 'more testing' without an obvious pathway to achieving that. Somebody help me with some technical details please: if I just change Template:Infobox Australian place/sandbox to contain
{{#invoke:Sandbox/Innesw/Infobox Australian place|main}}<noinclude>{{Documentation}}</noinclude>,
will that enable anybody to check the existing testcases? If so (but some further testing is reckoned necessary), or if not, what do I need to do as well / instead? Innesw (talk) 22:52, 26 March 2024 (UTC)

There is now a testcases page for the module. It is based on the testcases for the original template, though expanded to include all parameters dealt with by the template (except some deprecated ones).
I will soon elevate notices about the existence of the module and its testcases to Wikipedia talk:WikiProject Australian places, Wikipedia talk:Australian Wikipedians' notice board and Wikipedia:Australian Wikipedians' notice board. Innesw (talk) 11:42, 9 April 2024 (UTC)