Module talk:WikiProject banner

Moving notes to banner shell
There is some talk on Template talk:WikiProject banner shell about moving certain commonly used notes (e.g. attention needed, infobox needed, image needed) to the banner shell, to avoid multiple projects having to replicate the same parameter. Any comments over there please &mdash; Martin (MSGJ · talk) 15:09, 21 May 2024 (UTC)

Outdated code/hooks
I am working through the remaining templates using the old hooks. If anyone knows of any more please add to the list &mdash; Martin (MSGJ · talk) 15:29, 23 May 2024 (UTC)
 * Template:WikiProject Australian Roads - ✅
 * Template:WikiProject Indian roads - ✅
 * Template:WikiProject U.S. Roads - tricky
 * Template:WikiProject Figure Skating/A-Class review - ✅
 * Template:WikiProject Military history/aclass (and /sandbox) - ✅
 * Template:WikiProject Pirate Politics - ✅
 * Template:WikiProject The Beatles/sandbox - ✅


 * shows that hooks are used at Template:WikiProject Figure Skating/A-Class review, Template:WikiProject Military history/aclass (and /sandbox), Template:WikiProject Pirate Politics, and Template:WikiProject The Beatles/sandbox. Gonnym (talk) 11:33, 28 May 2024 (UTC)
 * Thanks, I'll look at those &mdash; Martin (MSGJ · talk) 15:34, 2 June 2024 (UTC)

auto doc category
Can auto also add the template to the project category? Either  or   category. Gonnym (talk) 11:27, 28 May 2024 (UTC)


 * Don't see any reason not to do this. Will sort in the next couple of days &mdash; Martin (MSGJ · talk) 15:35, 2 June 2024 (UTC)
 * Do you want it to check to see if  exists first. If so use it, otherwise use  ? &mdash; Martin (MSGJ · talk) 08:24, 4 June 2024 (UTC)
 * Yes, I think it's best to place it in the templates category if it exists. Gonnym (talk) 08:30, 4 June 2024 (UTC)
 * I agree. That is now coded in the sandbox, and will currently appear on sandbox templates for testing. When deployed it will only categorise the live templates. You can check Template:WikiProject Deaf/sandbox (which does not have a templates category) and Template:WikiProject Cycling/sandbox (which does have a templates category) &mdash; Martin (MSGJ · talk) 08:52, 4 June 2024 (UTC)
 * Great, looks good! Gonnym (talk) 09:19, 4 June 2024 (UTC)

Template:WikiProject United States
Hi, the template is populating Category:Pages with script errors, and it only displays the following message:

"The time allocated for running scripts has expired. The time allocated for running scripts has expired."

I don't know how to fix this, please help, thanks!! --Funandtrvl (talk) 17:00, 2 June 2024 (UTC)


 * Please can you provide an example of a page with a script error &mdash; Martin (MSGJ · talk) 08:21, 4 June 2024 (UTC)
 * @Funandtrvl &mdash; Martin (MSGJ · talk) 21:19, 6 June 2024 (UTC)
 * Hi, the problem fixed itself after a few hours. Thank you! --Funandtrvl (talk) 01:01, 8 June 2024 (UTC)

Syntax highlighting in automatic documentation
Could syntax highlighting be added to the automatic documentation (i.e. when auto)?

Current display (e.g. Template:WikiProject AfroCreatives):

Proposed:

Only applicable in the &  sections (I think). ~ Tom.Reding (talk ⋅dgaf) 17:42, 30 May 2024 (UTC)


 * That sounds good (and uncontroversial) to me, but after some searching, I have been unable to figure out where the relevant code is.  Sdkb  talk 18:31, 30 May 2024 (UTC)
 * It seems like it might be at Module:WikiProject banner/templatepage from lines 833-863. Someone who knows Lua would need to implement.  Sdkb  talk 18:35, 30 May 2024 (UTC)
 * Excellent idea. I will do it shortly unless someone else has already done it &mdash; Martin (MSGJ · talk) 15:33, 2 June 2024 (UTC)
 * Please check Template:WikiProject Cycling/sandbox and feed back? I notice you used the "inline" option but I don't know what difference that makes &mdash; Martin (MSGJ · talk) 08:36, 4 June 2024 (UTC)
 * Compare this:  which uses inline, with this:   which doesn't. -- Red rose64 &#x1f339; (talk) 12:37, 4 June 2024 (UTC)
 * Got it. So I think in this case we do not want "inline", so this should be good to go &mdash; Martin (MSGJ · talk) 17:15, 4 June 2024 (UTC)

A-class review tweaks
I have made some small changes to Module:WikiProject banner/config/sandbox and Module:WikiProject banner/auxiliary/sandbox to allow me to stop using custom code at Template:WikiProject Military history/aclass. The only differences is that kept and keep and treated the same as pass, and demote and demoted are treated the same as fail &mdash; Martin (MSGJ · talk) 12:03, 10 June 2024 (UTC)


 * Deployed &mdash; Martin (MSGJ · talk) 21:34, 10 June 2024 (UTC)

Warnings
I would like to add some prominent warnings when people try to use the class parameter in a project banner instead of in the banner shell template I'm sure the wording could be improved. What do you think? &mdash; Martin (MSGJ · talk) 12:08, 10 June 2024 (UTC)
 * If WikiProject banner shell is already on the page (but without a class parameter), then the message will say something like
 * If WikiProject banner shell is not on the page yet, then the message will say something like


 * Please add WikiProject banner shell to this page and add the quality rating to it. maybe something like this? Regardless, link the banner shell template. I'm in favor of the warning. Gonnym (talk) 21:38, 10 June 2024 (UTC)
 * Yep, probably a link a WP:PIQA somewhere in there too &mdash; Martin (MSGJ · talk) 21:39, 10 June 2024 (UTC)
 * This should be expended to any parameter we migrate to the shell, like listas do deal with redundant, duplicate or conflicting data. Gonnym (talk) 16:20, 11 June 2024 (UTC)
 * This is now coded on the sandbox. Example of the first message can be seen at Module talk:WikiProject banner/testcases. the second message below &mdash; Martin (MSGJ · talk) 10:24, 3 July 2024 (UTC)

Okay this is ready to go, but I will wait for and  to be emptied first to avoid ugly warnings on so many pages &mdash; Martin (MSGJ · talk) 09:35, 4 July 2024 (UTC)

Styles
@Gonnym: regading this edit, are you able to make the corresponding changes to Module:WikiProject banner/sandbox/styles.css? &mdash; Martin (MSGJ · talk) 13:25, 12 June 2024 (UTC)


 * I have very basic skills in CSS. @Izno can you help with this? Gonnym (talk) 17:02, 12 June 2024 (UTC)
 * I am happy to walk you through it; this task is a bit easier than poofing CSS out of thin air. The basic gist of what needs to be done here is:
 * See if there's a class some CSS can be attached to. The presence of  will usually make that obvious.
 * If no, add a class.
 * If yes, check to see if the uses in the generating module all need that particular CSS. If yes, proceed to 2. If no, add a specific class to that specific element to support the new CSS.
 * Move the CSS to the sheet.
 * I know you've done this before with ib-tv-episode. :P Izno (talk) 20:37, 12 June 2024 (UTC)

IM_TOPIC_CATEGORY may not be working in all cases
The documentation appears to say that IM_TOPIC_CATEGORY should provide a default category for requested images or photographs. In WikiProject Fishes, Wikipedia requested images of fish. The category exists at. Despite that looking correct to me, Talk:Bryconops sapezal uses that WikiProject template with yes, and the incorrect is added to the page. Can someone please troubleshoot or explain this apparent discrepancy? – Jonesey95 (talk) 23:07, 20 June 2024 (UTC)


 * I have applied a fix, hopefully will be resolved now &mdash; Martin (MSGJ · talk) 06:50, 21 June 2024 (UTC)

Tracking category proposed
There is a proposal to track uses of WikiProject banners which are placed outside the banner shell. The coding might be complex but I think this would be really useful &mdash; Martin (MSGJ · talk) 17:38, 29 June 2024 (UTC)
 * Originating discussion @ User talk:Kanashimi.  ~ Tom.Reding (talk ⋅dgaf)  18:12, 9 July 2024 (UTC)
 * If there is such a tracking category, my bots will automatically repair them by default. Kanashimi (talk) 08:50, 10 July 2024 (UTC)

Redirects not being added to PIQA category
I notice that on Talk:Mount Gorton ( redirects to Wilson Hills), all 3 WikiProjects are classified via 3 Stub, WPBS is not, and Talk:Mount Gorton is not added to. Could redirects be made to be included in the category, and eventually corrected? And any/all other page types also being omitted? ~ Tom.Reding (talk ⋅dgaf) 13:28, 1 July 2024 (UTC)


 * It is not in that category because it is a redirect and doesn't need a quality rating. The stub is just ignored on such pages. What needs to be corrected? &mdash; Martin (MSGJ · talk) 14:15, 1 July 2024 (UTC)
 * Since Talk:Mount Gorton refers to a redirect, Stub should be removed from the 3 WikiProjects.
 * I see now that is not an appropriate category name for such cases (as it implies they need a rating), but I still think it would be worth tracking these pages that use unnecessary quality ratings.   ~ Tom.Reding (talk ⋅dgaf)  14:53, 1 July 2024 (UTC)
 * In that case it should probably be in Category:WikiProject banners with redundant class parameter as the class stub is redundant (and incorrect, as redirects don't have ratings). Gonnym (talk) 15:01, 1 July 2024 (UTC)
 * Perhaps we could rename to Category:WikiProject banners with ignored class parameter? &mdash; Martin (MSGJ · talk) 15:06, 1 July 2024 (UTC)
 * "Redundant" seems most appropriate for proper articles which have a rating both inside a WikiProject and the shell.
 * "Ignored" seems most appropriate for these redirects (and other similar pages) which have irrelevant class parameters.  ~ Tom.Reding (talk ⋅dgaf)  15:15, 1 July 2024 (UTC)
 * They are the same in that the class parameter may safely be removed without having any effect. Do we need two separate categories? &mdash; Martin (MSGJ · talk) 15:42, 1 July 2024 (UTC)
 * With the speed at which these categories are being cleared, I'd say we don't. Less categories to watch. Gonnym (talk) 16:13, 1 July 2024 (UTC)
 * The way that the pages in these 2 would-be categories are fixed is different. In 1, WPBS's class is kept. In the other, WPBS's class, if found, is removed. Someone working on these categories in the future might not know to check the redirect-status of the page before proceeding, and perform the wrong operation.
 * But, if there is to be only 1 category to contain both of these cases, then I think "unnecessary" is better, as it can describe both "redundant" & "ignored" ~ Category:WikiProject banners with unnecessary class parameter. 2nd choice would be "ignored". With category text describing this distinction, regardless of the chosen descriptor.  ~ Tom.Reding (talk ⋅dgaf)  16:27, 1 July 2024 (UTC)

Preview warning: unexpected parameter "attention"
I'm getting a red warning saying, while attempting the following:

The interesting thing is, that in preview mode it is properly generating the notice with the diamond caution sign and "immediate attention needed", as well as displaying the name of the hidden attention-needed category in the footer that would be populated if I hit Publish, but all of that with the Preview error at the same time.

Not sure if it's relevant, but the PROJECT param is, and a couple of redirects are involved: Have I bolloxed it all up with the redirects, somehow? Can someone help me understand what's going on? Mathglot (talk) 07:25, 2 July 2024 (UTC)
 * the project page WP:WikiProject Intertranswiki/OKA task force is a redirect, pointing to WP:WikiProject Intertranswiki/OKA
 * the template Template:WikiProject Intertranswiki/OKA task force is a redirect, targeting WikiProject Intertranswiki/OKA.
 * Further data: I went ahead and saved the page with the Preview error anyway, at Draft talk:Contravention in French criminal law with the intention of pointing to the error here, but after publication the error was gone, and the banner message and hidden category look good. So far, so good; but attention is a valid parameter, so why does it say that it isn't in Preview? Preview mode still displays the error message now, if you edit it. Mathglot (talk) 07:36, 2 July 2024 (UTC)
 * It's because you did not define the BANNER_NAME parameter, and so it uses by default Template:WikiProject+PROJECT which in this case yields Template:WikiProject Intertranswiki/OKA task force which is not the template but a redirect. I have added BANNER_NAME which I think has fixed it &mdash; Martin (MSGJ · talk) 08:07, 2 July 2024 (UTC)
 * , Yes, it has! Thank you. Given the complexity of this Module, and the type of situations that might arise, I am considering adding a Troubleshooting section to the doc page, and this would be a good entry there. Or at least, where to look if you get that error message, would be a good start. Such a section might expand to cover other situations, as well. Thanks for  your fixes to that template. Mathglot (talk) 10:35, 2 July 2024 (UTC)
 * In general though, this error should be a very rare edge case, as task forces should not have standalone banners as they should use the one of the project they belong to. In this situation, there isn't a project one at this moment. Gonnym (talk) 10:57, 2 July 2024 (UTC)
 * , thank you for your comment I did notice that the module had params like tfN for handling task forces, and I wondered how to proceed with that, given that the parent WikiProject didn't have its own banner, so I did the best I could. What I'm hearing, is, maybe this is too rare a case to be worth writing up as a troubleshooting case, and I accept that. But, what is the right path forward, here? Should Intertranswiki have its own banner, and then */OKA would use the tfN params? Or, is it good enough, the way things are, now? Mathglot (talk) 11:06, 2 July 2024 (UTC)
 * I think that if there are not going to be any other task forces needing one, then don't bother changing it as it's already working. If another task force will need one then yes, they should be combined into one template. Gonnym (talk) 11:09, 2 July 2024 (UTC)

Dark mode support
I implemented dark mode support for the banners in these sandbox edits, without those on dark mode the banners are showing white text on light yellow background which is not great. The test cases seem good to me, but I would still appreciate a second set of eyes on the change before deploying it. Taavi (talk!) 22:20, 4 July 2024 (UTC)


 * Also ✅ for the non-sandbox version. Taavi (talk!) 11:58, 7 July 2024 (UTC)
 * Thanks. Maybe coordinate with User:Jdlrobson as he was working on this also &mdash; Martin (MSGJ · talk) 02:57, 8 July 2024 (UTC)