Module talk:WikiProject banner/Archive 14: Difference between revisions

Content deleted Content added
m Archiving 2 discussion(s) from Module talk:WikiProject banner) (bot
m Archiving 1 discussion(s) from Module talk:WikiProject banner) (bot
Line 739:
 
:These paler importance colours are now in use &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 07:48, 6 January 2024 (UTC)
 
== Possible room for improvement in the unknown parameter check ==
 
I don't know why I had to [https://en.wikipedia.org/w/index.php?title=Template%3AWikiProject_European_Microstates&diff=1195022260&oldid=1195003018 do this] (add pipes to parameter names) to have the template recognize the parameters as valid in the parameter check. See [https://en.wikipedia.org/w/index.php?diff=1195022358&oldid=1194955701#Andorra-importance this discussion]. Is there any documentation about how this module determines which parameters are valid? – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 23:38, 11 January 2024 (UTC)
 
:Coincidentally, a change was made to the sandbox earlier today which should resolve this &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 23:40, 11 January 2024 (UTC)
::Groovy. Thanks. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 00:15, 12 January 2024 (UTC)
:::Super. I'll note that the /doc currently has both (piped and un-piped) as examples, which led to my own confusion (see the edits previous to Jonesey's). [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 07:24, 12 January 2024 (UTC)
::::The unpiped form is generally not a good idea.
::::First consider the situation when the template code has the pipe in a line like <syntaxhighlight lang=wikitext> |tf 1 importance={{{Andorra-importance|}}}</syntaxhighlight> If that template is transcluded, it makes no difference whether the {{para|Andorra-importance}} parameter is absent from a transclusion, e.g. {{tlx|WikiProject European Microstates}} with no parameters, or is present but blank, e.g. {{tlx|WikiProject European Microstates|2=Andorra-importance=}} - in both cases the {{para|tf 1 importance}} parameter inside the template is fed an empty string.
::::Now consider the situation when the template code lacks the pipe - i.e. <syntaxhighlight lang=wikitext> |tf 1 importance={{{Andorra-importance}}}</syntaxhighlight> If that template is transcluded, it does make a difference whether the {{para|Andorra-importance}} parameter is absent from a transclusion, or is present but blank. When it is present but blank, the {{para|tf 1 importance}} parameter inside the template is fed an empty string, as expected. But when the {{para|Andorra-importance}} parameter is absent from a transclusion, e.g. {{tlx|WikiProject European Microstates}} with no parameters, the ''literal'' value <code><nowiki>{{{Andorra-importance}}}</nowiki></code> is passed through {{para|tf 1 importance}}. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 18:09, 12 January 2024 (UTC)