Module talk:WikiProject banner
![]() | If you wish to discuss the behaviour of the project banner inside the banner shell, then you may wish to post at Template talk:WikiProject banner shell instead. |
![]() | This module does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
|
![]() |
|
This page has archives. Sections older than 60 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Tidy up intersecting categories
[edit]I am looking at tidying up the intersecting quality/importance categories and there seem to be 3 types:
- Category:Draft-Class Ireland articles of Low-importance - this is a valid category but should be renamed to Category:Draft-Class Ireland pages of Low-importance in line with the move of Category:Draft-Class pages. This is under discussion here - please comment if you can.
- Category:FM-Class Palaeontology articles of NA-importance seems entirely redundant because all FM-class pages are rated as NA-class, so it will be an exact copy of Category:FM-Class Palaeontology pages. I have nominated for deletion here - please comment if you can.
- Category:NA-Class glass articles of Unknown-importance is invalid because it will never be used (NA-class will always default to NA-importance not Unknown-importance), so I will tag it for speedy deletion under {{db-c1}}.
— Martin (MSGJ · talk) 07:52, 2 April 2025 (UTC)
Misplaced banners by bot
[edit]In January 2024 there was an error in the bot's code which resulted in edits like this. I suspect that most of these have now been fixed but I am still finding the occasional example. So I was wondering if there is a way we could track these. I think that every banner should be above the first h2 heading, so perhaps some pattern that checks whether the banner code is before the first instance of 2 equals signs (==) — Martin (MSGJ · talk) 08:01, 2 April 2025 (UTC)
- Maybe similar code to Module:Is infobox in lead? Gonnym (talk) 08:45, 2 April 2025 (UTC)
- Looks promising — Martin (MSGJ · talk) 09:37, 2 April 2025 (UTC)
Different shades of green
[edit]
{{WikiProject banner shell}}
template instead of this project banner. See WP:PIQA for details.![]() | Aviation B‑class | |||||||||||||||
|
I am seeing two different shades of green when the B-checklist is used. I don't understand why because they are both using css class assess-b
which is defined in Module:WikiProject banner/styles.css as DFFFBF. I believe this is the paler colour, so I'm not sure where the other green is being defined. — Martin (MSGJ · talk) 10:20, 1 May 2025 (UTC)
- I see only one box with a green background above. Please link to an example page where this issue can be observed. My color picker tool is showing the one above as #DFFFBF. – Jonesey95 (talk) 17:14, 1 May 2025 (UTC)
- I see two. The one preceding "This article has been rated as B-class on Wikipedia's content assessment scale." is of colour (
#dfffbf
); the one preceding "This article has not yet been checked against the criteria for B-class status:" is of colour (#b2ff66
). They are distinctly different. --Redrose64 🌹 (talk) 20:57, 1 May 2025 (UTC)- That is weird because on my devices (and presumably Jonesey95's too) there is no background color for the "B" preceding "This article has not yet been checked against the criteria for B-class status:". To me it is #f8eaba, the color of the rest of the banner. This is the case even with
?safemode=yes
. I checked on Edge and Chrome on Windows, and Chrome on Android btw. —CX Zoom[he/him] (let's talk • {C•X}) 21:12, 1 May 2025 (UTC)- Well, that's what I get initially, using Firefox, but the green comes in after a fraction of a second. This is clearly a case of FOUC. --Redrose64 🌹 (talk) 22:04, 1 May 2025 (UTC)
- Is it different when you are logged out? I do not get a background color behind the second B (with the magnifying glass). I checked in Firefox for Mac (logged in), Chrome for Mac (logged out, regular and dark mode), and Safari for Mac (logged out). I also do not see any evidence of a background color when I use Inspect elements in my browser tools. Is it possible that some of you have .css customizations applying this color? Or maybe a different skin? I am using the Vector 2022 skin. – Jonesey95 (talk) 23:09, 1 May 2025 (UTC)
- Yes, it's different when logged out - both greens are shown at page load, there isn't even a flash of brown. --Redrose64 🌹 (talk) 16:29, 2 May 2025 (UTC)
- Is it different when you are logged out? I do not get a background color behind the second B (with the magnifying glass). I checked in Firefox for Mac (logged in), Chrome for Mac (logged out, regular and dark mode), and Safari for Mac (logged out). I also do not see any evidence of a background color when I use Inspect elements in my browser tools. Is it possible that some of you have .css customizations applying this color? Or maybe a different skin? I am using the Vector 2022 skin. – Jonesey95 (talk) 23:09, 1 May 2025 (UTC)
- All very strange. The magnifying glass background has always been green for me, on multiple browsers. But when I log out the background disappears. I do not see anything obvious in my personal CSS which could be causing this however. — Martin (MSGJ · talk) 10:08, 2 May 2025 (UTC)
- Even stranger: I am seeing the second green background behind the magnifying glass today. I haven't restarted my computer or even my browser. What a strange situation. Anyway, if we changed that green to dfffbf, would that satisfy those of us who can see the two colors? – Jonesey95 (talk) 17:29, 2 May 2025 (UTC)
- I think I figured out what may be happening. WOSlinker transcluded
<templatestyles src="Module:Class/styles.css"/>
in a comment below, so when the module asks for theassess-b
class, that class is now available to me. So I tentatively conclude: the banner is using two different classes, which are pulling colors from two different style sheets when they are available. The fix may be to make the banner module use the same class (probablyclass-b
) for both backgrounds. – Jonesey95 (talk) 17:46, 2 May 2025 (UTC)Fixed, I think, with this edit. – Jonesey95 (talk) 17:50, 2 May 2025 (UTC)
- Yup, even I was able to see the darker green color as of late. After your edit, I see the same color for both B's in the template. What I still do not understand is why the css was behaving differently for some of us, and differently for the rest yesterday. —CX Zoom[he/him] (let's talk • {C•X}) 18:09, 2 May 2025 (UTC)
- As I used to tell my customers when was a person who fixed computers: "I just fix things. Answering 'why' questions is a job for philosophers." – Jonesey95 (talk) 18:23, 2 May 2025 (UTC)
- I think I figured out what may be happening. WOSlinker transcluded
- Even stranger: I am seeing the second green background behind the magnifying glass today. I haven't restarted my computer or even my browser. What a strange situation. Anyway, if we changed that green to dfffbf, would that satisfy those of us who can see the two colors? – Jonesey95 (talk) 17:29, 2 May 2025 (UTC)
- Well, that's what I get initially, using Firefox, but the green comes in after a fraction of a second. This is clearly a case of FOUC. --Redrose64 🌹 (talk) 22:04, 1 May 2025 (UTC)
- A search over Template & Module namespaces show that #b2ff66 is the colour defined for B-Class at Module:Class/definition.json and Module:Class/styles.css. Where or why is it being called by the banner, I have no idea. —CX Zoom[he/him] (let's talk • {C•X}) 22:15, 1 May 2025 (UTC)
- That is weird because on my devices (and presumably Jonesey95's too) there is no background color for the "B" preceding "This article has not yet been checked against the criteria for B-class status:". To me it is #f8eaba, the color of the rest of the banner. This is the case even with
- I see two. The one preceding "This article has been rated as B-class on Wikipedia's content assessment scale." is of colour (
- Maybe this is the reason. Module:Class uses the assess-b class with css at Module:Class/styles.css and Module:WikiProject banner uses the class-b class with css at Module:WikiProject banner/styles.css. -- WOSlinker (talk) 12:44, 2 May 2025 (UTC)
- I didn't think we were using Module:Class or Module:Class/styles.css anymore, but perhaps I'm wrong — Martin (MSGJ · talk) 14:28, 2 May 2025 (UTC)
- When I am editing this talk page section and I pop open "Templates used in this section:", I see Module:Class/styles.css. That page is transcluded in 43K pages. We could change the B-class color there to #DFFFBF and see if anyone complains. – Jonesey95 (talk) 17:29, 2 May 2025 (UTC)
- It's not just the B class that is a different shade when comparing those two css files. -- WOSlinker (talk) 17:48, 2 May 2025 (UTC)
- If I remember correctly, the colors defined at Module:Class/definition.json were initially used for WP banners during the massive overhaul 2 years ago. There were complaints that these bright colors stand out too much and cause distraction to editors. Eventually, it was agreed to use a lighter pastel-like palette for all classes. —CX Zoom[he/him] (let's talk • {C•X}) 18:06, 2 May 2025 (UTC)
- That's probably because WOSlinker manually added those styles to this page. If you look at my sandbox you will not find those styles being used — Martin (MSGJ · talk) 06:29, 6 May 2025 (UTC)
- Yes, I figured that out above, and fixed it. The discussion ended up a bit out of order. – Jonesey95 (talk) 18:45, 7 May 2025 (UTC)
- So what do you see on my sandbox? — Martin (MSGJ · talk) 07:08, 8 May 2025 (UTC)
- In your sandbox I see: "1 2 3 4" – Jonesey95 (talk) 13:38, 8 May 2025 (UTC)
- @Jonesey95: Not those. MSGJ linked the relevant sandbox in their post of 06:29, 6 May 2025 (UTC). --Redrose64 🌹 (talk) 13:59, 8 May 2025 (UTC)
- Sorry, I couldn't see the link through the noise here. I see two of the same color light-green (#DFFFBF) background, as I would expect after I changed the magnifying-glass cell to use class-b with this edit. – Jonesey95 (talk) 14:17, 8 May 2025 (UTC)
- Ah, okay I hadn't noticed that edit. So everything makes sense then! — Martin (MSGJ · talk) 06:09, 9 May 2025 (UTC)
- Sorry, I couldn't see the link through the noise here. I see two of the same color light-green (#DFFFBF) background, as I would expect after I changed the magnifying-glass cell to use class-b with this edit. – Jonesey95 (talk) 14:17, 8 May 2025 (UTC)
- @Jonesey95: Not those. MSGJ linked the relevant sandbox in their post of 06:29, 6 May 2025 (UTC). --Redrose64 🌹 (talk) 13:59, 8 May 2025 (UTC)
- In your sandbox I see: "1 2 3 4" – Jonesey95 (talk) 13:38, 8 May 2025 (UTC)
- So what do you see on my sandbox? — Martin (MSGJ · talk) 07:08, 8 May 2025 (UTC)
- Yes, I figured that out above, and fixed it. The discussion ended up a bit out of order. – Jonesey95 (talk) 18:45, 7 May 2025 (UTC)
- It's not just the B class that is a different shade when comparing those two css files. -- WOSlinker (talk) 17:48, 2 May 2025 (UTC)
- When I am editing this talk page section and I pop open "Templates used in this section:", I see Module:Class/styles.css. That page is transcluded in 43K pages. We could change the B-class color there to #DFFFBF and see if anyone complains. – Jonesey95 (talk) 17:29, 2 May 2025 (UTC)
- I didn't think we were using Module:Class or Module:Class/styles.css anymore, but perhaps I'm wrong — Martin (MSGJ · talk) 14:28, 2 May 2025 (UTC)
WikiProject Higher education
[edit]I don't know if people are aware of the changes to Template:WikiProject Higher education which is now using a bespoke module to achieve some unusual behaviour (discussion here and here). The change allows editors to specify task forces by using a comma-separated list, i.e. |taskforce=cuny,uva
instead of the more usual method of |cuny=yes
and |uva=yes
.
The problem is that some features are not working (e.g. quality assessment and unknown parameter checking) and it is permanantly in Category:Pages using WikiProject banner shell needing attention. So I was wondering if there is a better way to do this, or whether we should look at coding something similar more widely for other projects to use. — Martin (MSGJ · talk) 12:27, 5 June 2025 (UTC)
- I have fixed the template — Martin (MSGJ · talk) 08:57, 10 June 2025 (UTC)
It seems that they wanted to store all their task forces in a configuration file instead of coding each one in the template. This allows the comma-separated list method of triggering each one, as well as keeping the configuration separate from the template code. I have mocked up an example of a config file at Template:WikiProject Higher education/config. It seems like a very neat way of working. The template would then become something as simple as
{{#invoke:WikiProject banner|main|project=Higher Education}}
Other advantages: we do not need to pass any parameters through the template, we could supply a list of parameter aliases instead of the horrible {{{a|{{{b|{{{c|}}}}}}}}} construct — Martin (MSGJ · talk) 13:28, 16 June 2025 (UTC)
- I believe we have a working template for the moment, but we always had the vision of expanding this to other areas/uses, so would appreciate any support in making that happen..! Tduk (talk) 13:34, 17 June 2025 (UTC)
- I'm still becoming familiar with this whole lua/template set-up. Would it be at all reasonable to have a parameter to WikiProject banner which points in some way to a helper lua module/function which can be passed the list of args, and return a modified list of args? (Sort of like what we ended up doing but in reverse). This would offer expandability in all sorts of ways. This might be what you've been angling towards yourself. Tduk (talk) 04:01, 18 June 2025 (UTC)
- Please can you explain what you mean by "be passed the list of args, and return a modified list of args", preferably with an example? — Martin (MSGJ · talk) 09:23, 18 June 2025 (UTC)
- Absolutely. If you took a look at my hokey lua module, you might see what I mean. But something like:
if(args["ProjectArgs"]=="Higher Education") then args=HigherEducationArgParser(args) end
- or, even better (if possible)
if(args["ProjectArgs"]!=nil) then args=_G[args["ProjectArgs"]](args) -- or some other way to define the function name in the template end
- placed somewhere appropriate in Wikiproject_banner, and written a bit more maintainably...
- called like this:
{{#invoke:WikiProject banner|main|ProjectArgs=HigherEducationArgParser}}
- If you wanted, this could be collapsed into how you were calling it:
{{#invoke:WikiProject banner|main|project=Higher Education}}
- and the pseudocode might look like:
local ProjectFunc=string.gsub(args["project"]," ","_") .. "_Argument_Function" if(ProjectFunc]!=nil) then args=_G[ProjectFunc](args) -- not sure this works in our framework end
- Apologies if there are errors, I never saw a line of lua until a few weeks ago, but I'd love to help in any way I can. Does this help explain what I mean? Tduk (talk) 13:51, 18 June 2025 (UTC)
- I understand most of what you have written, but I still have no idea why you would want to do this, or what the end goal might be. What are you actually trying to achieve, that you can't do now? — Martin (MSGJ · talk) 16:46, 19 June 2025 (UTC)
- Please can you explain what you mean by "be passed the list of args, and return a modified list of args", preferably with an example? — Martin (MSGJ · talk) 09:23, 18 June 2025 (UTC)