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

Content deleted Content added
m Archiving 1 discussion(s) from Template talk:WPBannerMeta) (bot
m Archiving 2 discussion(s) from Template talk:WPBannerMeta) (bot
Line 28:
:Understood. When I first coded this I assumed the done() were required in order to close the tags. Then I noticed that none of your examples on WT:LUA had them so guessed that tags were closed automagically. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:26, 4 July 2023 (UTC)
::Sure, if you had a mental model of an ongoing string of text being built up, I understand how you might think this. What happens though is that the function calls build a tree of objects representing the HTML. When <syntaxhighlight lang="Lua" inline>tostring()</syntaxhighlight> is invoked on the banner variable, the tree is rendered into HTML, and thus as the tree is traversed, the corresponding start and end tags will be generated. [[User:Isaacl|isaacl]] ([[User talk:Isaacl|talk]]) 22:00, 4 July 2023 (UTC)
 
== Script error if no image ==
 
{{ping|MSGJ}} If a banner has no image set then it's displaying a script error at the moment. For example: {{tl|WikiProject Dictionary of National Biography}} or {{tl|WikiProject Anatolian Civilizations task force}}. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 06:36, 7 July 2023 (UTC)
 
:Thanks, this should now be fixed &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 07:44, 7 July 2023 (UTC)
 
== Adding redirect class ==
 
At [[Wikipedia talk:WikiProject Council#Proposed changes to extended quality scale]] I proposed adding redirect-class to the standard extended scale, because lots of projects use it. There has been no opposition in nearly a month so I will look at implementing this shortly.
 
In order to avoid creating lots of new categories, while also avoiding red categories appearing on pages, I suggest we add an existence check to the module code so that:
* If [[:Category:Redirect-Class PROJECT articles]] exists then it will be used by projects using the extended scale.
* If [[:Category:Redirect-Class PROJECT articles]] does not exist then redirects will continue to be placed in [[:Category:NA-Class PROJECT articles]]
This will give projects a choice: if they want to track redirects then they can just create the category. If this approach works, we could roll it out to other non-article classes like Portals too. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:21, 27 June 2023 (UTC)
 
:Now coded on the sandbox &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 22:09, 4 July 2023 (UTC)
:This is now deployed. FWIW I think we could now use the "full quality scale" aka the "extended scale" for all projects. Based on the same logic the class will only be used if the category exists, otherwise it will just use NA-class. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 12:14, 7 July 2023 (UTC)