Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a223faf1eb667929

Jump to content

Module talk:Articles by class

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 2 months ago by MSGJ in topic Mobile view

Rename?

[edit]

I have now merged Module:Articles by importance into this module by move out the common functionality into a separate function and calling this with different configuration options. It would make sense to rename this module to something more generic (taking "quality" out)  Martin (MSGJ · talk) 14:57, 27 March 2025 (UTC)Reply

Planning to move to Module:Articles by class unless anyone has a better idea  Martin (MSGJ · talk) 06:17, 7 May 2025 (UTC)Reply
 Done  Martin (MSGJ · talk) 10:37, 7 May 2025 (UTC)Reply

format=toc

[edit]

Potential removal of this argument:

Aluxosm (talk) 09:47, 8 October 2025 (UTC)Reply

Custom arguments

[edit]

The |custom1= and |custom2= arguments are used so rarely that they might be able to be removed. I'm currently searching through them and removing any that use pre-existing classes (like SIA).

Aluxosm (talk) 09:19, 15 October 2025 (UTC)Reply

This feature either uses {{Importance}} or {{Class}} to style and display the text in the table. The importance template is more permitting and lets you put anything in there, but the class template is more strict and just breaks if it's not a known type; all of the known types however are already accounted for by this module. See their use here: Wikipedia:Department of Fun#Quality and importance assessment. Maybe we could just dumb down the logic and get rid of the template calls so a little fun can still be had haha. Aluxosm (talk) 09:34, 15 October 2025 (UTC)Reply

In your first post you argue for the removal of these parameters. In your second post you seem to asking for more freedom to input anything?  Martin (MSGJ · talk) 13:54, 15 October 2025 (UTC)Reply
Sorry for confusing, was mostly joking because the only user of these options that I could see was the Department of Fun 😆. I've since gone through and cleaned up all of the old uses where they were just set to a class that's no longer used; in doing so, I only came across a single other place: Category:National Register of Historic Places articles by importance (Related-importance). Not sure what the best course of action is but I think it's probably best to leave the parameters undocumented. Aluxosm (talk) 14:30, 15 October 2025 (UTC)Reply
Ohh, for some reason I thought that the calls to the {{Importance}} and {{Class}} templates only originated from these options, so in removing them you could trim a load of code. Obviously not the case though so there's no drama keeping this in for testing and for the couple edge cases. Definitely no rush on this bugfix at least, as |custom1= is only used on two pages, and |custom2= isn't actually used anywhere! Aluxosm (talk) 15:24, 15 October 2025 (UTC)Reply
Let's just get rid of custom2?  Martin (MSGJ · talk) 17:29, 15 October 2025 (UTC)Reply
Not fussed, up to you. Apologies for the flip-floppy thread! I just went down a rabbit hole after reading the code wrong 😅 it did lead me to fixing a load of the uses of this template though so it wasn't for nothing! Aluxosm (talk) 02:17, 20 October 2025 (UTC)Reply
Removed custom2 on the sandbox. Also made custom and alias for custom1  Martin (MSGJ · talk) 11:38, 20 October 2025 (UTC)Reply

Root categories and 'Category:Wikipedia 1.0 assessments'

[edit]

Should the root categories (TOPIC articles by quality & TOPIC articles by importance) be automatically added to Category:Wikipedia 1.0 assessments? Just like how the sub-categories are currently added to their parents. It would be one less thing for the WikiProject catalyst tool I'm working on to handle, but I can understand not wanting to jam everything into this module. Aluxosm (talk) 13:04, 27 October 2025 (UTC)Reply

A root category would be a good idea, but WP:1.0 is pretty much a historical/obsolete page  Martin (MSGJ · talk) 14:17, 27 October 2025 (UTC)Reply
As far as I'm aware, having these in Category:Wikipedia 1.0 assessments is vital for User:WP 1.0 bot to function correctly. I think that it only actually uses the "root" TOPIC articles by quality categories to work out the list of pages connected to a WikiProject, ignoring TOPIC articles by importance, but having both in there is definitely the norm and may be required by other tools/workflows.
If the Wikipedia 1.0 assessments category was applied by this module it would make any future categorisation changes easier.
...I think I may have confused things by using the word "root" here; I've added a note to the catalyst tool's docs to hopefully clear it up. Aluxosm (talk) 21:03, 27 October 2025 (UTC)Reply
In that case, please feel free to add it to the module  Martin (MSGJ · talk) 05:43, 28 October 2025 (UTC)Reply
I think this will do it, but please test it  Martin (MSGJ · talk) 22:38, 28 October 2025 (UTC)Reply
Cheers Martin! Yet again, beat me to it but was for the best, much cleaner solution. I promise I'm taking notes haha, will hopefully be of a bit more help soon.
Just tested it out and it all looks good. I've got a couple other ideas though so probably worth holding off and bundling them together tomorrow. Thanks again, Aluxosm (talk) 14:17, 30 October 2025 (UTC)Reply
Think that's it for the moment; add away if you're happy 🤙. Aluxosm (talk) 21:22, 30 October 2025 (UTC)Reply
 Done  Martin (MSGJ · talk) 11:18, 4 November 2025 (UTC)Reply

Removal of class=nocat

[edit]

The ability to disable categorisation by setting |class=nocat was added to the template in 2008 (see this discussion), and then presumably transferred here. This was done to allow the template to be added to the root topic articles by quality category without it being added to to the x-Class articles categories. Since then however, the categorisation logic has improved enough that this is unnecessary. This was being used in a few places (incorrectly mind, as |nocat=yes), but I've since gone through and cleaned them up (example):

With the addition of the ability to categorise the root categories into Category:Wikipedia 1.0 assessments (discussion), we could add an option to disable categorisation that doesn't rely on the |class= parameter so that it could be used anywhere, maybe using |nocat=yes intentionally this time, but I'm not sure that it's particularly necessary. Aluxosm (talk) 20:38, 30 October 2025 (UTC)Reply

Removed in the sandbox (diff) Aluxosm (talk) 20:43, 30 October 2025 (UTC)Reply

Better page checking for template placement

[edit]

The current page checking logic applies {{Possibly empty category}} to any category page that {{AbQ}} or {{AbI}} is on, as long as it's title isn't topic articles by quality/importance.

	if title.namespace==14 and not title.text:match('^' .. topic .. ' articles by ' .. cfg.qualimp .. '$') then
		out = frame:expandTemplate{title='Possibly empty category'}
	end

The problem with this is that there are 23 category pages (at the moment) where both {{AbQ}} and {{AbI}} are placed together where the title check doesn't apply. I'm thinking we just use the same check for the |class= parameter that's in use elsewhere so that the template only shows up on the second-tier x-Class topic articles or x-importance topic articles; what do you reckon? Aluxosm (talk) 21:07, 30 October 2025 (UTC)Reply

Changes in the sandbox (diff). Aluxosm (talk) 21:17, 30 October 2025 (UTC)Reply
Looks good. I've done some tweaking and simplifying. Do you know if the |parent= or |sort= parameters are used much?  Martin (MSGJ · talk) 23:03, 30 October 2025 (UTC)Reply
You read my mind, they were both actually added to my to-do list of things to investigate/fix/document yesterday after seeing them everywhere:
I removed all of the |parent= parameters in the 17 pages I edited when I was looking at class=nocat because they were all seemingly following the format of {{Article classification}} and {{Article importance}} and pointing to the parent WikiProject instead of the parent category (as can be seen in this correct example); It may have been intentional but because they weren't in the x-Class articles/pages or x-importance articles/pages categories the arguments were being ignored anyway. I'd imagine a large number of the results in those searches are also unnecessary or incorrect.
Here are some other related but deprecated parameters:
Aluxosm (talk) 06:35, 31 October 2025 (UTC)Reply
Bit hypocritical for me to remove the |parent= params if they were actually intentional after complaining about a similar thing 😅. Let me know what you reckon and I'll stick them back in if needed! Aluxosm (talk) 06:41, 31 October 2025 (UTC)Reply
All the ones I have checked seemed to be completely redundant. Have you found any which are not?  Martin (MSGJ · talk) 09:55, 31 October 2025 (UTC)Reply

Could we suppress the {{possibly empty category}} in all cases when the category title does not match the expected format? That would avoid a lot of cases when this template is being duplicated like at Category:Computer networking articles by quality and importance  Martin (MSGJ · talk) 09:09, 31 October 2025 (UTC)Reply

Could do, but the change I made in the sandbox (diff) already achieves this by checking if class is set as that should only be the case on x-Class articles/pages or x-importance articles/pages categories. It also works when the category doesn't have a name in the expected format and is set manually. Aluxosm (talk) 10:00, 1 November 2025 (UTC)Reply
Ah, I hadn't really noticed that edit. Okay then. Just to clarify if |class= is set manually on a non-standard page then do we want {{emptycat}} or not? Will there ever be a need to set class manually?  Martin (MSGJ · talk) 14:38, 1 November 2025 (UTC)Reply
Nope, you're right. I've just searched for pages that don't match the format expected by each template (these don't check that they have the right suffix) and none differ so class should always be set correctly:
and the {{Empty cat}} template shouldn't be on any of them because they all have sub categories, all apart from these two where the template was actually already there before I removed it:
So checking to make sure the title matches the expected format is probably better way to go about it. Aluxosm (talk) 05:58, 2 November 2025 (UTC)Reply
If we just remove the ability to set class manually, this will be equivalent to your solution  Martin (MSGJ · talk) 09:09, 2 November 2025 (UTC)Reply
Sounds like a plan 🤙 Aluxosm (talk) 09:08, 4 November 2025 (UTC)Reply
 Done. Next we should look if |sort= and/or |parent= can safely be removed.  Martin (MSGJ · talk) 11:20, 4 November 2025 (UTC)Reply

Option to suppress empty cat

[edit]

When a project becomes defunct it would be handy to be able to suppress the {{empty category}} template just on that project's categories. Currently the only way is to remove the template from the page completely. I'm thinking we could keep a "suppress list" on a subpage and if the "topic" parameter matches one on that list then the template will be suppressed.  Martin (MSGJ · talk) 11:32, 4 November 2025 (UTC)Reply

 Done, by creating a table called "suppress". I have added Britney Spears and you can see that Category:Stub-Class Britney Spears articles no longer has the empty category template so should be deleted shortly  Martin (MSGJ · talk) 00:00, 30 December 2025 (UTC)Reply
Good stuff! Yeah, a subpage would be preferable so that the module's history isn't full of WikiProject changes. Would it also be possible to have it so that it's just a plain text list?
Britney Spears
Florida Gators
United States comics
Women's basketball
...instead of:
['Britney Spears'] = true,
['Florida Gators'] = true,
['United States comics'] = true,
['Women\'s basketball'] = true
Not much of an issue but I would imagine that it'd make maintenance easier. Aluxosm (talk) 10:36, 30 December 2025 (UTC)Reply
Definitely agree with a submodule. The list is possible - the code is not quite so efficient, but that's not an issue. Please see Module:Articles by class/suppress. Please feel free to test by using {{cat class/sandbox}}.  Martin (MSGJ · talk) 16:59, 31 December 2025 (UTC)Reply
Did you have a chance to look at this yet?  Martin (MSGJ · talk) 12:18, 12 January 2026 (UTC)Reply
 Done  Martin (MSGJ · talk) 09:42, 13 January 2026 (UTC)Reply
Thinking about it, do you reckon it might be useful to have a separate module entirely that's essentially just a table of project, status, topic mappings? For example WikiProject Water sports/RNLI task force, active, RNLI, with topic only being set if assessments are/were used. Aluxosm (talk) 11:02, 30 December 2025 (UTC)Reply
I would need to think about this, as it is perhaps out of the scope of this module. Where do you see this table being used?  Martin (MSGJ · talk) 12:19, 12 January 2026 (UTC)Reply

Just a note that this subpage has now been removed as it was unnecessarily complicated. Now the {{empty category}} will be suppressed in all cases when the total number of articles in the whole category tree is zero, which should never happen in real situations  Martin (MSGJ · talk) 07:19, 14 April 2026 (UTC)Reply

Mobile view

[edit]

Can we remove :addClass('nomobile') and get this visible on mobile devices? These templates are generally only used on WikiProjects and other backrooms of Wikipedia, where concerns of page overflow are not really important. (They are also far from the only templates that do such.) The template does not even appear when putting it into desktop view! Why? I Ask (talk) 16:15, 13 May 2026 (UTC)Reply

I think the reason is that it can have a very wide output which would not be suitable for mobile displays. Perhaps we could develop a more responsive styling that would improve that?  Martin (MSGJ · talk) 14:22, 14 May 2026 (UTC)Reply
Yes, but this module does not even show up when you force it into desktop view on my Android despite other templates that cause page overflow (like some navboxes) showing. It would be nice to have a mobile skin, though. Why? I Ask (talk) 14:28, 14 May 2026 (UTC)Reply
Sorry, I can't explain that. I would assume that nomobile would not apply in desktop view  Martin (MSGJ · talk) 14:38, 14 May 2026 (UTC)Reply
Module:Navbox does not have nomobile, though the reason navboxes do not show up is a larger Wikimedia issue (see phab:T124168). Is there something similar built into the mobile skin that concerns this module? If nomobile was removed, would it still be hidden in the mobile skin? Why? I Ask (talk) 14:59, 14 May 2026 (UTC)Reply
I have removed nomobile from the sandbox, so you could test on Template:Articles by Quality/sandbox, etc. if you wish  Martin (MSGJ · talk) 15:53, 14 May 2026 (UTC)Reply
Strangely, it seems to work on the mobile skin just fine and appears as a scrollable bar (no overflow issues). There are some issues with it being slightly squished with the GA and FA icons, though. But in portrait desktop view, the Vector (2022) and Timeless skins kind of... break it. It looks great in MonoBook and Vector Legacy, though. This is above my pay grade in coding, so do you have any advice in how to fix it for the certain skins and fix the mobile view icons? At the very least, at least it now appears! Why? I Ask (talk) 16:56, 14 May 2026 (UTC)Reply
No I don't, but you could probably get some good advice on WP:VPT. They might also be able to explain why nomobile stops it appearing in desktop mode  Martin (MSGJ · talk) 21:14, 14 May 2026 (UTC)Reply