Template talk:Class mask

From Wikipedia, the free encyclopedia
Jump to: navigation, search
edit·history·watch·refresh Stock post message.svg To-do list for Template:Class mask:
  • Add "demote to Start-class" option for B-checklist

What's this for?[edit]

The idea is that this template will make it easier for projects to create their own custom quality scales for use with their project banner. Eventually it may make sense to put this "inline" without needing a separate subpage. — Martin (MSGJ · talk) 09:35, 31 July 2009 (UTC)

forceNA option[edit]

I saw the todo list & I've added a forceNA option in the sandbox. -- WOSlinker (talk) 10:06, 6 September 2009 (UTC)

Looks good. — Martin (MSGJ · talk) 11:08, 6 September 2009 (UTC)
Ok, I've copied it over. I've also added future, current, needed & merge class options as well. Haven't updated the docs yet though. -- WOSlinker (talk) 11:32, 6 September 2009 (UTC)

FQS option[edit]

I've also added a FQS option in the sandbox. -- WOSlinker (talk)

Yes, I like the way you've done this because we can use things like |FQS=yes |project=no to give everything except Project-Class, can't we? — Martin (MSGJ · talk) 12:28, 6 September 2009 (UTC)
I didn't think of that when I added the FQS param but yes that should work. -- WOSlinker (talk) 12:36, 6 September 2009 (UTC)
Got a slight bug for you to fix. If |FQS=yes |file=yes it would be nice if the output was File rather than Image. — Martin (MSGJ · talk) 17:55, 6 September 2009 (UTC)
Would swapping the order of file & image in the switch statement fix it or would that introduce any other issues? -- WOSlinker (talk) 20:53, 6 September 2009 (UTC)
That might do it. I guess the first match in the switch will be output? — Martin (MSGJ · talk) 21:00, 6 September 2009 (UTC)
Seems to be working. — Martin (MSGJ · talk) 07:26, 11 September 2009 (UTC)

Weird stuff happening with the use of this template[edit]

When you guys put this on the Template:WikiProject Food and drink/class page, all of the assessments switched to unassessed. --Jeremy (blah blahI did it!) 03:18, 15 September 2009 (UTC)

Sorry, it's because I forgot to pass the class parameter! Fixed now. — Martin (MSGJ · talk) 06:04, 15 September 2009 (UTC)
I've added a warning box in case anyone makes this mistake again. — Martin (MSGJ · talk) 06:23, 15 September 2009 (UTC)

On a side note[edit]

Was it you guys that added the auto assessment icon? I got a kick out of the Bender-esque face on the assessment tags. --Jeremy (blah blahI did it!) 03:21, 18 September 2009 (UTC)

It was PC78 who suggested it at Template_talk:WPBannerMeta#Auto.3Dyes_is_a_bit_intrusive. -- WOSlinker (talk) 06:15, 18 September 2009 (UTC)

Why aren't redirects lumped with the FQS?[edit]

Is this normal? Also, there's an inconsistency in the documentation. Says FQS enables the 6 classes, but only lists five. Headbomb {ταλκκοντριβς – WP Physics} 23:12, 20 September 2009 (UTC)

FQS hasn't included Redirect since April. It was decided that too few projects needed it for it to be worth imposing on all projects. FQS enables the following six:
  • Image, Category, Disambig, Portal, Template, Project
— Martin (MSGJ · talk) 06:50, 21 September 2009 (UTC)

Thoughts on B-class checklist[edit]

The current method used to evaluate whether the B-class checklist is satisfied (i.e. with the |b= parameter) may need rethinking. The main thing I don't like about it, is that it is not possible to tell whether the checklist is being used or not. (The documentation on /table should ideally show whether it is in use or not. The other thing I have been thinking about, is an auto-promote setting which would automatically rate articles tagged with C-class as B-class if the criteria were all satisfied. Any thoughts on either of these would be welcome. — Martin (MSGJ · talk) 16:06, 21 September 2009 (UTC)

You would only ever use the b parameter if you were using the checklist and can't you tell if b is being used by using {{#ifeq:{{{b|¬}}}|¬|Not used|Used}}. However, passing though all the b1..b6 parameters and also an optional Start-Until (or perhaps a better name) would allow the B-class checklist to work with all currently used possibilities (including: using a 6 point check list, using a 5 point check list, B or C only rating and B, C and Start rating)

The code about needs checking & testing though. I've got an example in User:WOSlinker/list2 -- WOSlinker (talk) 18:43, 21 September 2009 (UTC)

Might even be worth adding to the main WPBannerMeta template. -- WOSlinker (talk) 19:46, 21 September 2009 (UTC)
Hmm, interesting ideas.
  1. The problem with the used/unused thing at the moment is that B has to be passed as default, so ¬ is never going to reach the /table page.
  2. Good idea to normalise the criteria on WPBannerMeta itself.
  3. Not sure about Start-Until ... I think there are just ?two banners which use this. Do you think it's worth it?
  4. I did think about passing the number of satisfied criteria from /class ... or perhaps the number of unsatisfied criteria would be more helpful.
  5. How about promoting from C? Useful or not needed?
— Martin (MSGJ · talk) 21:21, 21 September 2009 (UTC)
How about allowing the B_CHECKLIST parameter, so that instead of
|b={{{b|B}}}

you could have:

|b={{#if:{{{B_CHECKLIST|}}}|{{{b|B}}}|B}}
|c={{#if:{{{B_CHECKLIST|}}}|{{{b|C}}}|C}}

? This would provide the promoting from C. -- WOSlinker (talk) 21:48, 21 September 2009 (UTC)

Could do ... but it seems like we are using two parameters when one would suffice. What about using |B_CHECKLIST=PASS or something? And do you think auto-promotion should be an option or the norm? — Martin (MSGJ · talk) 11:43, 22 September 2009 (UTC)

I've remembered why we shouldn't normalise the B-criteria on WPBM itself. Because some hooks need to evaluate them, it is better to avoid code duplication and put it on /class I think. — Martin (MSGJ · talk) 11:11, 8 October 2009 (UTC)

I was looking again at your Start-Until suggestion. Do you still want to do this? An alternative might be PASSES_FOR_C which would be the number of criteria which need to pass in order to be C-class. (The default would be zero of course.) — Martin (MSGJ · talk) 11:02, 14 May 2010 (UTC)

Could do. Could also work in an autopromote option as well. Will have to wait a week or so though (unless you want to do it) as I'm away. Will need some testcases too. -- WOSlinker (talk) 17:24, 14 May 2010 (UTC)
Okay, I may have a tinker in the sandbox but I'll wait for you to check it when you return. — Martin (MSGJ · talk) 20:59, 16 May 2010 (UTC)
Some code on the /sandbox. I think the neatest solution is to use a meta-template which will tell us which interval a value lies in. I had a look for a such a template and couldn't find one, so I made one which is currently at User:MSGJ/Interval. — Martin (MSGJ · talk) 09:53, 21 May 2010 (UTC)
Poke — Martin (MSGJ · talk) 12:36, 9 June 2010 (UTC)
Been a bit busy recently. Will see if I can take a look soon. -- WOSlinker (talk) 20:01, 9 June 2010 (UTC)
Poke. Would you be able to take a look at this because we will need to make the Image->File change shortly? Thanks — Martin (MSGJ · talk) 17:21, 26 July 2010 (UTC)
Added some more test cases for 5 point checklists and the PASSES_FOR_C option. Had to alter the range to get it to work for those checklists as if b6=unused, it counts as 1 in the totals. Everything else seems ok. -- WOSlinker (talk) 18:40, 26 July 2010 (UTC)
Hmm, yeah, good catch. Maybe we are not using the best syntax here then because I don't like this way of coding because we are having to check the parameters twice. Would FAILS_FOR_C be any easier? — Martin (MSGJ · talk) 18:47, 26 July 2010 (UTC)
Or maybe just put an instruction on the documentation: "If you are using a 5-point checklist please add one to the PASSES_FOR_C parameter." — Martin (MSGJ · talk) 18:52, 26 July 2010 (UTC)
It's only one parameter that's checked twice as there are only 5 & 6 point checklists (no 3 or 4 ones). If you wanted to code it the otherway, the parameter would actually need to be called FAILS_FOR_START. -- WOSlinker (talk) 19:00, 26 July 2010 (UTC)

(undent)FAILS_FOR_START would be okay - sorry but my brain is a bit fuzzy: would we avoid checking any parameter twice if we switched to that method? And do you oppose my second solution? Sorry to be a pain, but as this is such a high-traffic template I think we should be as efficient as possible. (And, I think this may need a bit more thought so I'm going to take this out of the sandbox for now and prepare the Image-File thingy.) — Martin (MSGJ · talk) 20:20, 26 July 2010 (UTC)

Questions[edit]

  1. Is this template designed specifically for {{WPBannerMeta}}, or can it be used by non-meta banners?
  2. I see support has been added for five additional sub-topics. Any chance of increasing this to ten?
  3. Hypothetically speaking, if I wanted A-Class assessments to be dependant on a successful A-Class review (in the same way that B-Class is dependant on a completed checklist), how feasible would it be to do it using this template? PC78 (talk) 23:07, 6 October 2009 (UTC)
Although it is currently only used by WPBM banners, the reason it was hived off is that it could be used by any banner. I think the answer to the last two questions are the same. If a feature would be useful to a significant number of projects then it can of course be implemented here. But if it is only likely to be of use to one or two projects then I would say that it's probably not worth putting here. As it used by 1.6 million pages, performance is a consideration. What extra classes did you have in mind? — Martin (MSGJ · talk) 09:25, 7 October 2009 (UTC)
Say, for example, if a custom mask was doing something like:
a={{#ifeq:{{lc:{{{A-Class|}}}}}|pass|A}}
How easy would it be for this template to do something like that? PC78 (talk) 23:14, 7 October 2009 (UTC)
Well the first thing would be to alter Template:WPBannerMeta and Template:WPBannerMeta/class so that an A-class parameter is passed to custom class masks. As this function is unlikely to be used by more than a handful of projects (there aren't many that even use A-class) it's probably not worth adding it to this template though. — Martin (MSGJ · talk) 11:09, 8 October 2009 (UTC)

Disambiguation[edit]

The template should interpret "Disambiguation" as "Disambig". PC78 (talk) 18:15, 18 October 2009 (UTC)

Yes, probably. And Dab seems a likely one to keep, but I wonder if Disamb is used anywhere ... — Martin (MSGJ · talk) 19:54, 19 October 2009 (UTC)
{{editprotected}} Could Template:Class mask/core/sandbox be copied over to Template:Class mask/core. I've added the Disambiguation as asked for above & also tpl and img class aliases as used by the WikiProject Trains Banner. Thanks. -- WOSlinker (talk) 15:43, 26 October 2009 (UTC)
Yes check.svg Done — Martin (MSGJ · talk) 18:04, 26 October 2009 (UTC)

Adding Book-Class to the class mask[edit]

{{edit protected}} This will be used to tag Wikipedia Books for the various wikiprojects. I wanted to add this to the physics banner, but apparently the banner uses this class mask to generate classes (and others projects will most likely want to as well in the near future). Could someone update the class-mask accordingly? Headbomb {ταλκκοντριβς – WP Physics} 02:31, 17 November 2009 (UTC)

This template is only intended to cater for widely used classes. If it becomes widely used in the future, then we could certainly add it here, but for now I suggest adding it to the custom class at Template:Physics/class. (Yes, you wouldn't be able to use this template anymore.) — Martin (MSGJ · talk) 08:15, 17 November 2009 (UTC)
Alright so how do I do that? Adoption would be greatly simplified however, if it was done through this template. I also don't see the point of purposefully limiting the use of the class mask. Enabling by default would certainly be overkill, but I can see of no negative aspect to having it bundled up with the rest of them. Headbomb {ταλκκοντριβς – WP Physics} 08:42, 17 November 2009 (UTC)
I think PC78 has now done this for you. The idea is that {{class mask}} is suitable for 99% of projects and is as simple and efficient as possible. Therefore we don't add classes which are used by just one or two projects. (For example Template:WikiProject Plants/class doesn't use this template because they use SL-class.) I agree that there would be no harm in adding this if it becomes used by several projects. — Martin (MSGJ · talk) 17:04, 17 November 2009 (UTC)
Then could we add it? The class is new, so hasn't had time to be adopted by several projects (physics has it now, but that required PC78 to intervene). There will probably be a signpost article about it in the relatively near-future about it, as well as a mention on WP:AALERTS, but I don't want to publicize this until the backbone is ready for large-scale adoption. I doubt you want to create custom classes for dozens of wikiprojects coming here at once, asking for help with custom classes. Headbomb {ταλκκοντριβς – WP Physics} 19:57, 18 November 2009 (UTC)
It might be preferable to wait and see what level of interest there is in Book-Class, but I guess it's a kind of chicken and egg situation. PC78 (talk) 00:11, 19 November 2009 (UTC)
That is indeed the situation. It's not wise to push for the adoption of a class when it's not supported and requires projects to go through hoops to make it work. The class wouldn't be enabled by default, so it won't annoy anyone who doesn't want to be annoyed by it. From the current library, several wikiprojects would be interested in this (the usual big ones, such as biographies, music, physics, biology, chemistry, astronomy, military history, music, videogames, geography, aviation, ...). If adoption after two-three months is comparable to say ...No-importance articles, then it can always be removed. But I doubt that will be the case. Headbomb {ταλκκοντριβς – WP Physics} 02:47, 19 November 2009 (UTC)

I'm not in favour of adding support for a class here which is currently used by 5 pages. It's far too premature. I don't know about "jumping through hoops" - before this convenience template was built, that was the only way to add custom classes to a banner! I'm thinking about an improved syntax for this template however which would allow additional classes to be easily supported, see the next section. — Martin (MSGJ · talk) 12:15, 19 November 2009 (UTC)

The previous way was a horrible thing to request of projects to take upon themselves. There's 5 pages now because I couldn't make sense of how to add support for the class for the physics projects, so I couldn't (and still can't) go and ask people "hey, add the book-class" and not be able to answer the "OK, but how do I do that?" question. Support the class, and most of the 500 pages will probably be tagged by the end of the year, as well as well as result in an increase of the number of books. While streamlining the process to add custom classes is a good thing, I don't think it makes much sense to anticipate that the book-class could not even reach the level of adoption that Category:Merge-Class articles (9 Projects) or as Category:Current-Class articles (16 projects), both of which are supported. Headbomb {ταλκκοντριβς – WP Physics} 16:48, 19 November 2009 (UTC)
Tagging books for the physics project is as simple as adding {{Physics|class=Book}} to the talk page, so I'm not sure why you're having difficulty there. I'm inclined to think that you're over-estimating how popular books and Book-Class will be, but I guess that remains to be seen. PC78 (talk) 17:04, 19 November 2009 (UTC)
Tagging is trivial, that's not what I'm talking about. I'm talking about modifying project banners to support the book-class. It would be trivial to do if |book={{{book|}}} was added to the class mask. It wouldn't be trivial to do if I was asking them to do modify their banners like you did. I'm not saying that hundreds of projects will adopt the book-class overnight, but to think that it won't be at least comparable to the merge-class by the end of the year is grossly underestimating how popular the book-class will be.
Not to sound impatient or ungrateful, but if I'm wrong, then it can be removed at no great loss. If I'm right, then we taking a lot of time talking about whether to include ~20 characters [unless I'm forgetting something] in this template, which could be spent on making sure the inclusion of these 20 characters didn't break something, and that the book-class is successful and popular. Headbomb {ταλκκοντριβς – WP Physics} 17:34, 19 November 2009 (UTC)
I'll defer to Martin's judgement regarding changes to this template, but I do agree that there seems to be no real negative to adding it here (and for the few other unsupported classes as well). I think I misread your previous comment, but I'm still not clear about what it is you want to do; other projects can worry about their banners. If it helps, custom class masks are documented here, and the examples on that page could be updated to cover Book-Class. PC78 (talk) 18:09, 19 November 2009 (UTC)

I'm not quite following the discussion below, what's the status on this? Headbomb {ταλκκοντριβς – WP Physics} 14:30, 22 November 2009 (UTC)

Book-Class can now be enabled with this template by adding the parameter |BOOK=Book. Not all banners with custom masks use this template, though. Those would need to add Book-Class in the same way I added it to {{Physics}}. PC78 (talk) 16:15, 24 November 2009 (UTC)
So the physics template could revert to using the class mask, and add |BOOK=Book, and it would work? Headbomb {ταλκκοντριβς – WP Physics} 16:41, 24 November 2009 (UTC)
I believe Martin has already done it. You don't have the namespace detect for Book-Class anymore, so a blank |class= parameter will default to Project-Class, but IIRC you weren't overly concerned about that anyway. PC78 (talk) 16:55, 24 November 2009 (UTC)
Excellent, thanks a bunch! Also {{Class mask/table}} needs to be updated. Headbomb {ταλκκοντριβς – WP Physics} 17:09, 24 November 2009 (UTC)

Now that we have a new namespace for books, we should update this template so that namespace detection works (and |class=book is not required). I think WOSlinker has been coding this in the template sandboxes. I also tentatively propose that Book-class be added to the extended (FQS) quality scale. This was suggested at Wikipedia_talk:WikiProject_Video_games/Archive_77#Book-class and would bring it in line with the other namespace-based classes. This would need discussing somewhere central though as it would affect all 0 projects using this scale. — Martin (MSGJ · talk) 19:37, 31 December 2009 (UTC)

That would be incredibly helpful and would greatly simplify things for me. I could tag articles without going to the tedious process of explaining the book-class, asking for consensus, getting minimal feedback, making an edit protected request one week later, THEN tag the book. While I am biased in this, so far no projects declined using it (although some were indifferent, their attitude being "Well even if it's not that useful for us, it doesn't do any harm") (Currently ~35 have adopted the book-class). Headbomb {ταλκκοντριβς – WP Physics} 04:02, 1 January 2010 (UTC)
Posted for comments on WT:COUNCIL. — Martin (MSGJ · talk) 08:11, 2 January 2010 (UTC)

Improved syntax to support "unrecognised" classes[edit]

Perhaps we can do something similar to the way {{importance mask}} is coded to allow for any class to be supported by passing it as the name of a parameter. For example, if we used something like

{{#switch:{{lc:{{{class|}}}}}
...
 #default = {{yesno
  |1     = {{{{{lc:{{{class|}}}}}|}}}
  |yes   = {{ucfirst:{{{class|}}}}}
 }}
}}

that would allow |cheesecake=yes and Cheesecake-class will be implemented. — Martin (MSGJ · talk) 12:21, 19 November 2009 (UTC)

Possible code is now in Template:Class mask/sandbox. Needs checking and maybe simplifying ... Just one annoyance: It will currently only work for classes with an initial uppercase letter (e.g. Book). It would be great if it could work with others (e.g. SL) as well. — Martin (MSGJ · talk) 18:00, 19 November 2009 (UTC)
Would it be able to handle the namespace/pagename detect I added to {{Physics/class}} for Book and Project-Class? PC78 (talk) 18:30, 19 November 2009 (UTC)
With
{{#switch:{{lc:{{{class|}}}}}
...
 #default = {{yesno
  |1     = {{{{{lc:{{{class|}}}}}|}}}
  |yes   = {{{ {{lc:{{{1}}}}} }}}
 }}
}}
it is then possible for it to work with SL.
{{Class mask/sandbox|sl
|book=Book
|sl=SL
}}
-- WOSlinker (talk) 19:34, 19 November 2009 (UTC)
I've done something slightly more complex in the sandbox now, so that both |book=yes and |book=Book work. -- WOSlinker (talk) 19:51, 19 November 2009 (UTC)
Wow, that's genius! I think we can remove all the extra code for future-class, merge-class, etc. now. — Martin (MSGJ · talk) 22:43, 19 November 2009 (UTC)

The only possible refinement I can think of is to use uppercase parameter names for the new syntax and retain the lowercase ones for the current behaviour yes/no. It's not really important because there will never be a "yes-class"! But it might keep the syntax clearer? Could we use the same trick to allow some of the standard classes (e.g. A-class or C-class) to be switched off? — Martin (MSGJ · talk) 17:11, 20 November 2009 (UTC)

I think I've simplified things a bit. Do my changes look okay? If so I think we are ready to go ahead with this. However I think this template can be improved more in the future. — Martin (MSGJ · talk) 17:33, 22 November 2009 (UTC)
It doesn't appear to be working for SL-Class, if that's a concern. Also, you can't have multiple values for a class, so you couldn't use it for Bplus-Class if you wanted the banner to accept either "bplus" or "b+". PC78 (talk) 17:40, 22 November 2009 (UTC)
Thanks for the feedback but I don't think you're quite right. The new syntax now works in uppercase - see /testcases for an example of SL-class. Bplus can be done with something like the following. — Martin (MSGJ · talk) 17:48, 22 November 2009 (UTC)
{{class mask|{{{class|}}}
 |B+    = Bplus
 |BPLUS = Bplus
}}
Is everyone happy with this syntax (lowercase parameter just to switch it on with an initial capital letter, and uppercase to actually specify what the class is)? If so, I think we can implement. — Martin (MSGJ · talk) 16:43, 23 November 2009 (UTC)
Yes check.svg Done — Martin (MSGJ · talk) 21:34, 23 November 2009 (UTC)

If it's not too much of a dumb question, how does the template generate multiple custom classes? PC78 (talk) 00:15, 23 November 2009 (UTC)

Well, it only checks parameters which match the input. For example, if class=bAnAnA then it will check the parameter {{{BANANA}}} and if that isn't defined it will then check the parameter {{{banana}}}. Quite clever! — Martin (MSGJ · talk) 16:43, 23 November 2009 (UTC)

Namespace detection for custom classes[edit]

Ah, OK. What about namespace detections for the custom classes? PC78 (talk) 19:09, 22 November 2009 (UTC)
Do you mean your titleparts magic on Template:Physics/class? I'm not sure it would be a good idea on this template as it is special code only relevant to the book-class. And I can't think of any other custom classes which would require namespace detection. But anyway, can we do one thing at a time? :) — Martin (MSGJ · talk) 19:23, 22 November 2009 (UTC)
A namespace detect for User-Class would be useful too. It shouldn't matter that the titleparts code is only used for Book-Class. If this template is going to be used to implement Book-Class in banners, then there's no reason not to have it, otherwise books are going to end up with an incorrect default of Project-Class. PC78 (talk) 19:43, 22 November 2009 (UTC)
I've taken the liberty of moving this down as it is separate to the issue above and probably needs further discussion. — Martin (MSGJ · talk) 16:39, 23 November 2009 (UTC)
In general I remain opposed to adding code here for the benefit of few projects. User-class is used by two projects as far as I know, and Book-class is still only used by one. Unless these numbers change significantly, I don't think is unreasonable to expect them to code their own class masks. Let's see what other people think about this issue though. — Martin (MSGJ · talk) 16:46, 23 November 2009 (UTC)
OK, but isn't this whole change—clever though it may be—ultimately being done for the benefit of just a few projects? I'm only counting seven projects that use classes other than those already supported by this template. PC78 (talk) 17:42, 23 November 2009 (UTC)
Actually this will simplify the template a lot because it will mean we can take out the special code for Merge-, Future- and Current-class. — Martin (MSGJ · talk) 18:40, 23 November 2009 (UTC)
I think "a lot" may be overstating it a little. In order to remove the special code for the classes you mention, won't you need to find and update uses of those classes first? The /table subtemplate will need updating too, but we I guess can revisit the namespace issue if Book-Class takes off. PC78 (talk) 21:39, 23 November 2009 (UTC)

Common configurations?[edit]

Featured article FA  A-Class article A   GA  Bplus-Class article Bplus  B-Class article B  C-Class article C  Start-Class article Start  Stub-Class article Stub  Featured list FL   List   Current   Future  Wikipedia Book Book  Category page Category  Disambiguation page Disambig   Draft  Featured media FM   File   Merge   Needed   Portal   Project  Redirect page Redirect   Template   NA   ???  Total
0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 3

Is there any easy way of knowing which configurations people are using most often in class masks? The one I tend to see the most is the standard assessment scale plus Category, Disambig and Template, but it would be useful if there were some proper stats to look at. PC78 (talk) 19:06, 19 November 2009 (UTC)

See the template above. Pages in category reflect the number of subcategories (aka 31 means 31 projects and taskforces). Headbomb {ταλκκοντριβς – WP Physics} 21:03, 19 November 2009 (UTC)
Thanks, but that'snot really what I meant. I'm interested in what combinations the classess are used in, not how ofetn each one is used individually. PC78 (talk) 21:41, 19 November 2009 (UTC)
Think you'd find that FQS+redirect is the most common option. A lot of custom masks were created when Redirect-class was dropped from the default. — Martin (MSGJ · talk) 12:22, 20 November 2009 (UTC)

Further improvements and simplifications[edit]

So the recent developments seem to be working and I am looking at further improvements in the same vein:

  • Adding parameters for all classes so that the standard ones may be switched off, e.g. |A=no would turn off A-class.
  • With the number of required parameters decreasing, perhaps it would be simpler if the template was de-cored.
  • We will need a separate template for the documentation. I'm thinking about moving /table to /templatepage as this would be more logical. And the documentation could be called automatically using noinclude - something like
{{class mask<noinclude>/templatepage</noinclude>|{{{class|}}}
 |topic = etc.
}}
  • Unfortunately that will mean changing a lot of templates, but it would have the advantage that the main template can be simplified a lot. — Martin (MSGJ · talk) 17:38, 24 November 2009 (UTC)
No objection to the further refinements of the template, but I do have the following questions:
  1. Is support for |redirect=, |future=, |current=, |merge= and |needed= to ultimately be removed in favour of the new unnamed parameters? Do we need a tacking category for these?
  2. Will the table be able to support the new unnamed parameters?
  3. How feasible will it be to add namespace detection for Book-Class and User-Class if/when they become more widely used?
Since we seem to be heading towards using this template for pretty much all custom masks, it should be preferable to provide as much functionality and flexibility as possible. PC78 (talk) 18:01, 24 November 2009 (UTC)
  1. Future, current and merge have already been removed from /core. I have only left them on the main template for the time being for the benefit of /table. I hesitated with Redirect and Needed because these behave a little differently. If these classes are used when they are not in use, the mask will default to NA-Class rather than Unassessed (with the logic that we can at least say they are not articles). The other non-article classes (e.g. Disambig) work in the same way.
  2. Yes, but we will need to recode it so that it checks all possible classes.
  3. I don't foresee any technical difficulty in that.
I agree with you, with the usual caveat that we don't complicate the template for the benefit of very few projects. — Martin (MSGJ · talk) 18:09, 24 November 2009 (UTC)
Should the mask not default to NA if Merge-Class is unused? AFAIK it's typically used for redirects of merged articles. PC78 (talk) 18:30, 24 November 2009 (UTC)
Really? I always thought it was for articles that need merging with another article. — Martin (MSGJ · talk) 18:35, 24 November 2009 (UTC)
That's how I've always looked at it. I could be wrong though, it's not something I've had much involvement with. PC78 (talk) 18:57, 24 November 2009 (UTC)

Here's a hypothetical question for you (if it's not too o/t): if a Topic-Class was created at some point in the future, how much would it screw with templates like this that use a |topic= parameter? :D PC78 (talk) 20:11, 24 November 2009 (UTC)

Haha. Luckily |TOPIC=Topic would work! But an interesting question. — Martin (MSGJ · talk) 21:29, 24 November 2009 (UTC)
Oh s**t, try typing |class=FQS into any WPBannerMeta template ... :S — Martin (MSGJ · talk) 21:31, 24 November 2009 (UTC)
? I don't see a problem. PC78 (talk) 21:33, 24 November 2009 (UTC)
We need to rethink the syntax because any banner using the |FQS=yes has effectively enabled yes-class. Look:
WikiProject Articles for creation (Rated yes-class)
WikiProject icon This template was created via the article wizard and reviewed by member(s) of WikiProject Articles for creation. The project works to allow unregistered users to contribute quality articles and media files to the encyclopedia and track their progress as they are developed. To participate, please visit the project page for more information.
Symbol question.svg yes  This template does not require a rating on the project's quality scale.
 
Would changing |FQS= to |fqs= make a difference? PC78 (talk) 21:50, 24 November 2009 (UTC)
Hmm, well lowercase parameter names will interfere with the lowercase syntax and uppercase ones will interfere with the uppercase syntax. There a few ways to avoid this problem, such as:
  • Make the parameters which are not related to classes have mixed capitalisation (e.g. like forceNA)
  • Append something like -class to all the class parameters. So |redirect=yes would become |redirect-class=yes.
But both would require a lot of work to change over. So maybe it's better just to change the uppercase syntax which has just been implemented (and accept that |topic=yes will never work). I'll keep thinking about this. — Martin (MSGJ · talk) 22:03, 24 November 2009 (UTC)

Not too difficult to fix. Just needed to filter out some values before passing through to custom. See sandbox change. Does mean though that you can't have a FQS class. -- WOSlinker (talk)

Sure, we could do it that way. It's just not a very clean way to code the template ... — Martin (MSGJ · talk) 21:33, 25 November 2009 (UTC)

I've moved /table to /templatepage as I proposed above and I have started the process of recoding it so that it doesn't depend on the main template. (This will enable the syntax above to be used and so the documentation for Book-class and other custom classes should start to work.) However it's not perfect just yet. — Martin (MSGJ · talk) 10:47, 5 December 2009 (UTC)

Inline usage[edit]

The documentation for WPBannerMeta says that inline masks should not be used if the banner uses any hooks, which seems to contradict what the documentation here says. Which is correct? PC78 (talk) 03:30, 26 November 2009 (UTC)

Any hook which uses the quality class, i.e. /taskforces or /qualimpintersect or /qualitycats. Because otherwise the code would need to be duplicated. PS Why are you editing at 3.30am? Couldn't sleep? :O — Martin (MSGJ · talk) 07:24, 26 November 2009 (UTC)
I'm a creature of the night. :) PC78 (talk) 12:09, 26 November 2009 (UTC)

On a semi-related note, can custom masks be used in the task force hook? PC78 (talk) 19:00, 26 November 2009 (UTC)

Only for QUALITY_SCALE at the moment as IMPORTANCE_SCALE hasn't been implemented yet. On the todo list though. -- WOSlinker (talk) 22:14, 26 November 2009 (UTC)

Banners not using this template[edit]

Here's a list of WPBannerMeta banners with custom classes that don't use this template:

Banner Mask Reason
{{Chemicals}} subpage no FA, GA, C, FL, List-Class
{{Composers}} subpage no C, FL-Class
{{Department of Fun}} inline Category, File, Project, Template, NA-Class only, Bottom-importance only
{{GreenBayPackersProject}} subpage no C-Class
{{Pittsburgh Steelers project}} subpage no A-Class
{{WPAFC-admin}} inline Category, File, Project, Template, User, NA-Class only
{{WPAVIATION}} subpage customised assessments relating to the B-Class checklist
{{WPCATSUP}} subpage Category, File, Project, Template, User, NA-Class only
{{WPMeasure}} subpage no FA, GA, FL-Class
{{WikiProject Editing trends}} subpage Category, Image, Project, Template, User, NA-Class only
{{WikiProject Ethiopia}} subpage no C or FL-Class
{{WikiProject Firearms}} subpage Deferred-Class
{{WikiProject Heraldry and vexillology}} subpage no C or FL-Class
{{WikiProject Israel}} subpage no FL-Class
{{WikiProject Lists}} subpage Stub, FL, List, Category, Disambig, Image, Portal, Project, Template, NA-Class only
{{WikiProject Philately}} subpage no FL-Class
{{WikiProject Pokémon}} subpage no FL-Class
{{WikiProject Republic of Macedonia}} subpage no C-Class
{{WikiProject Xbox}} subpage no FL-Class

I'm not sure why some of these don't already use {{class mask}} -- perhaps I missed something in the code? It was suggested above about adding parameters for all classes, so hopefully the above data will be of use in that regard. PC78 (talk) 00:50, 29 November 2009 (UTC)

Thanks for this. The main reason that not all custom masks use this template is that it was never seriously deployed, it just sort of crept in. There are various things about this template which I am not yet happy with. Apart with the fundamental issue with the class parameters which I am still mulling over, I am rather dissatisfied with the current implementation for B-class checklists. The current set up, with half of the code in WPBannerMeta/class and the other half here, is confusing and does not lend itself well to automatic documentation. Luckily there are not too many banners which use it, so it won't be too much work to change them all! — Martin (MSGJ · talk) 23:15, 29 November 2009 (UTC)
At the last count, 347 Template namespace transclusions of {{class mask}}. PC78 (talk) 23:45, 29 November 2009 (UTC)

Proposed changes[edit]

The code in the /sandbox will:

  • de-core the template (no longer any advantage I think)
  • add the code for checking B-class checklists. (This will tidy the interplay with {{WPBM}} and also allow inline masks with the bhecklist.)
  • remove a few parameters that are now unneeded. (E.g. no special parameter for future-class is now needed.)
  • stop automatically calling /templatepage. This is for simplicity, otherwise every conceivable parameter has to be passed there. Instead the <noinclude>/templatepage</noinclude> syntax can be used.

— Martin (MSGJ · talk) 11:29, 27 April 2010 (UTC)

To-do list - Add ability to turn off FA/A/GA-class[edit]

I've made some changes in the sandbox to implement the ability to turn off a class item but not just for FA/A/GA, I've done it for all of FA/A/GA/B/C/Start/Stub/FL/List. There's also a testcase as well. -- WOSlinker (talk) 18:42, 28 April 2010 (UTC)

That looks okay. The reason I only suggested it for FA/A/GA is that I didn't anticipate any need to switch the others off. (If Stub/Start/C/B are not being used then the class mask is so bespoke that this template probably doesn't help.) But I suppose it doesn't do any harm ... — Martin (MSGJ · talk) 19:30, 28 April 2010 (UTC)
FL & C are mentioned in the table above a few times. -- WOSlinker (talk) 19:42, 28 April 2010 (UTC)
Ah, good point. Is there any advantage in using the approach we use on {{importance mask}} and grouping the parameters together? — Martin (MSGJ · talk) 21:22, 28 April 2010 (UTC)
Could do. I've changed the sandbox to that method. -- WOSlinker (talk) 21:51, 28 April 2010 (UTC)
Okay. (I wasn't saying it was simpler that way, I was just thinking aloud.) What about using pagetype to automatically switch to NA instead of unassessed for non-articles? (Code in sandbox.) — Martin (MSGJ · talk) 11:02, 29 April 2010 (UTC)
I can't really see aany occasions where it will get down to the pagetype part when on non-article pages as the switch NAMESPACE part just above that would cover all those. -- WOSlinker (talk) 17:44, 29 April 2010 (UTC)
I guess you're right. I was thinking about the non-article pages in mainspace, but I guess the disambig and redirect options need to be retained because of the variants for each. — Martin (MSGJ · talk) 10:35, 30 April 2010 (UTC)

Yes check.svg Done — Martin (MSGJ · talk) 10:54, 30 April 2010 (UTC)

Image -> File[edit]

There is code on the sandbox to rename Image-Class to File-Class in the cases that FQS is set to "yes". Does it look okay? — Martin (MSGJ · talk) 20:28, 26 July 2010 (UTC)

Added some more testcases. I think the 3rd one down should be File rather than Image, so needs a fix. -- WOSlinker (talk) 20:39, 26 July 2010 (UTC)
Also 5 & 6 don't seem to be working properly. -- WOSlinker (talk) 20:41, 26 July 2010 (UTC)
Fixed now I think with [1] -- WOSlinker (talk) 20:44, 26 July 2010 (UTC)
You're never going to want both Image- and File-class simultaneously. — Martin (MSGJ · talk) 20:52, 26 July 2010 (UTC)
If you don't want it that way and want just one then I think the file param should be before the image param in the switch statement. -- WOSlinker (talk) 20:59, 26 July 2010 (UTC)
Umm, brain hurting again ... — Martin (MSGJ · talk) 21:13, 26 July 2010 (UTC)
Okay back up slightly. What do you think should happen if |FQS=yes|image=yes? — Martin (MSGJ · talk) 21:20, 26 July 2010 (UTC)
I think that should go to File for auto-namespace detection, if class=file passed then File and if class=image passed then image. -- WOSlinker (talk) 21:28, 26 July 2010 (UTC)

────────────────────────────────────────────────────────────────────────────────────────────────────That's admittedly logical but quite complicated, and improbable that this would behaviour would ever be desired. The current code assumes that both will never be wanted and |FQS=yes|file=yes implicity turns off Image-Class. Would that approach not make sense now? — Martin (MSGJ · talk) 21:31, 26 July 2010 (UTC)

I'm just going to put your code in because I don't want to think about this anymore :) But wouldn't we want this to achieve the behaviour you describe above? — Martin (MSGJ · talk) 21:42, 26 July 2010 (UTC)
Yes, I'd actually forgotten to change that one. -- WOSlinker (talk) 21:47, 26 July 2010 (UTC)
Okay Yes check.svg Done, that was more complicated than I thought it would be! — Martin (MSGJ · talk) 22:19, 26 July 2010 (UTC)

As Image-Class is not used by any projects these days I have removed support for it. Of course it is still possible to add it as a custom class, but namespace detection will always give File-class. — Martin (MSGJ · talk) 11:48, 9 June 2011 (UTC)

Category for incomplete B-class assessments[edit]

If a project uses this template to implement a B-class rating system, it would be nice if they could have a category to track articles that have incomplete B-class checklists. I don't see anything like that in the code now - did I miss it? — Carl (CBM · talk) 19:04, 15 April 2011 (UTC)

I'm not sure this template would be the best place to implement those categories. Probably a better place would be to add something into Template:WPBannerMeta/hooks/bchecklist. -- WOSlinker (talk) 20:06, 15 April 2011 (UTC)
Discussion at Template_talk:WPBannerMeta/hooks#Checklist_tracking_categories. -- WOSlinker (talk) 20:28, 15 April 2011 (UTC)
Thanks. — Carl (CBM · talk) 22:14, 15 April 2011 (UTC)

FM-Class[edit]

If File-class is used but FM-class is not used then an input of FM should probably default to File-class rather than NA-class. — Martin (MSGJ · talk) 11:49, 9 June 2011 (UTC)

Yes, would be good. The following should do that I think. -- WOSlinker (talk) 17:55, 9 June 2011 (UTC)
 |fm       = {{#ifeq:{{{fm}}}|yes|FM|{{#ifeq:{{{file|{{{FQS}}}}}}|yes|File|NA}}}}
Okay looks good, and done. — Martin (MSGJ · talk) 10:30, 10 June 2011 (UTC)

Help needed with task force[edit]

So I can't figure out how to get class category pages by namespace to populate for the New York Knicks task force:

Featured article FA   GA  B-Class article B  C-Class article C  Start-Class article Start  Stub-Class article Stub  Featured list FL   List  Wikipedia Book Book  Category page Category  Disambiguation page Disambig   File   Portal   Project  Redirect page Redirect   Template   NA   ???  Total
0 3 17 43 224 274 2 2 1 15 1 104 0 23 8 12 0 0 729

Some examples include Category talk:New York Knicks and Talk:Knicks. As far as I can tell, Template:WikiProject National Basketball Association and Template:WikiProject National Basketball Association/class are configured correctly. Any help will be appreciated. NYCRuss 19:46, 30 December 2011 (UTC)

Everything looks as thouugh it is configured ok in the banner. Probably the Job queue is being a bit slow. -- WOSlinker (talk) 20:02, 30 December 2011 (UTC)
Thanks for checking it out. It does indeed seem to be some kind of system lag. NYCRuss 01:42, 31 December 2011 (UTC)

An additional class[edit]

I am interested in using an additional class. If it has merit, it would be great seeing it incorporated into the "Class mask" template. The class would be: UA for "unassessable", a class distinct from unassessed for it would define a page as having: "significant questionable inclusions and/or omissions, sufficient to place deletion peril upon the page". This would facilitate additional tracking capabilities and perhaps quarantine the worst class examples, by noindexing them when the assessment is in place. Coding the assessment similar to the behavior of CSD, disallowing its removal by the page creator, with bot enforcement, would increase the significance, and usefulness, of such a class option. I am keen to see the thoughts others might have to these regards, and I thank all for indulging this post. Best - My76Strat (talk) 19:08, 28 April 2012 (UTC)

Hi My76Strat. Adding a new class to a WikiProject banner is very easy to do and I could help you with that. There would be no need to add it to this template unless there was a consensus that it be universally adopted (i.e. added to every WikiProject banner). I'm not sure whether you will get agreement for that, and in any case it would be better to try it out on a few projects first to see if it works well. — Martin (MSGJ · talk) 15:08, 14 May 2012 (UTC)

Image Class / File Class categories[edit]

The Template:Class mask/templatepage subcomponent of this template contains logic to list categories of the format "Image-Class wibble articles". These have been deprecated in favour of categories styled "File-Class wibble articles", and globally deleted/renamed/moved (see Wikipedia:Categories_for_discussion/Log/2010_July_3#Category:Image-Class_articles).

Can the current code that checks for both be simplified to drop the checks for "Image-Class wibble articles" categories please? - TB (talk) 21:26, 6 December 2012 (UTC)

Yes check.svg Done -- WOSlinker (talk) 23:22, 6 December 2012 (UTC)
Cheers. - TB (talk) 07:45, 7 December 2012 (UTC)

Redirect[edit]

Can we use Module:Pagetype to automatically assign NA-class to redirects? — Martin (MSGJ · talk) 10:34, 12 November 2013 (UTC)

Not necessarily, because some WikiProjects permit |class=redir, see for example Category:Redirect-Class rail transport articles --Redrose64 (talk) 10:41, 12 November 2013 (UTC)
Yes of course, so I should update my suggestion. If no |class= parameter is used, and if the page is a redirect then it will automatically get rated as Redirect-class if that class is in use, otherwise it will get NA-class. — Martin (MSGJ · talk) 12:58, 12 November 2013 (UTC)

Draft namespace[edit]

Could we add the draft namespace please? —  HELLKNOWZ  ▎TALK 15:20, 27 December 2013 (UTC)

Yes check.svg Done -- WOSlinker (talk) 18:22, 27 December 2013 (UTC)

Protected edit request on 1 September 2014[edit]

Please could we make "Draft" the default class for all drafts, to make them easier to identify via projects.

  • Add |draft below |stub on line 23.

For a test case, Draft talk:Dead Waves (band) and Draft talk:Metaltech (Band) should both say "This page has been assessed as Draft class" and be assigned to the category Category:Draft-Class Heavy Metal articles. Ritchie333 (talk) (cont) 17:21, 1 September 2014 (UTC)

There are currently only 23 projects that support the Draft-Class. I think there would need to be a RFC before making it a default for all projects. -- WOSlinker (talk) 17:27, 1 September 2014 (UTC)
See related discussion - Wikipedia talk:WikiProject Articles for creation#Review & cleanup for some long-time AfC drafts? Ritchie333 (talk) (cont) 17:33, 1 September 2014 (UTC)
@Ritchie333: Red information icon with gradient background.svg Not done: please establish a consensus for this alteration before using the {{edit template-protected}} template. Also, I see three problems with your proposal.
  • I don't think that auto-detection of draft class should be enabled for all projects, just those that have |QUALITY_SCALE=extended.
  • Adding a new line as you suggest would break the existing line further down,
     |draft    = {{#ifeq:{{{draft}}}|yes|Draft|NA}}
    
    It would be better to amend that line.
  • It would only work on banners where the talk page use has the explicit parameter |class=draft, it would not detect by namespace.
I address all three concerns in my edit to Template:Class mask/sandbox (diff). --Redrose64 (talk) 19:55, 1 September 2014 (UTC)
Okay, thanks for the heads up. I'm coming from the point of view of a problem and hopefully the regulars here can advise on better ways to implement a solution. Ritchie333 (talk) (cont) 13:16, 2 September 2014 (UTC)
This proposal would affect a large number of projects, so I agree it does need a proper discussion appropriately advertised. I can't see it attracting much opposition though. — Martin (MSGJ · talk) 15:56, 2 September 2014 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── OK, there are three possible routes:

  1. Leave things as they are:
    • each project that uses |QUALITY_SCALE=inline or |QUALITY_SCALE=subpage can opt-in to Draft-class if they choose to, by adding |draft=yes to the {{class mask}} template. For inline, the {{class mask}} template is inside the {{WPBannerMeta}} template of the WikiProject banner; for projects with subpage, it is in the /class subpage of the banner.
    • those with |QUALITY_SCALE=extended or |QUALITY_SCALE=standard cannot use Draft class without changing |QUALITY_SCALE= to either inline or subpage
  2. Add Draft to the FQS group (Category, Disambig, File, Portal, Project, Template):
    • each project that uses |QUALITY_SCALE=inline with |FQS=yes or |QUALITY_SCALE=subpage with |FQS=yes would be given Draft-class with the ability to opt-out by adding |draft=no to the {{class mask}} template (see option 1)
    • each project that uses |QUALITY_SCALE=inline without |FQS=yes or |QUALITY_SCALE=subpage without |FQS=yes can opt-in to Draft-class if they choose to, exactly as for option 1
    • each project that uses |QUALITY_SCALE=extended would be given Draft-class without opt-out, other than by switching to another |QUALITY_SCALE=
    • those with |QUALITY_SCALE=standard cannot use Draft class without changing |QUALITY_SCALE= to one of the others
  3. Add Draft to the standard group (FA, A, GA, B, C, Start, Stub, FL, List, NA):
    • each project that uses |QUALITY_SCALE=inline or |QUALITY_SCALE=subpage would be given Draft-class with opt-out, exactly as for option 2 with |FQS=yes
    • each project that uses |QUALITY_SCALE=extended or |QUALITY_SCALE=standard would be given Draft-class without opt-out, other than by changing |QUALITY_SCALE= to either inline or subpage

We won't arrive at a final decision in just two days. I !vote for Option 2: add Draft to the FQS group. --Redrose64 (talk) 19:06, 2 September 2014 (UTC)

As I mentioned elsewhere, I think "opt-in" is going to be the most pragmatic option. We can tag drafts for all the projects we like, but unless the project is known as being active and responsive (eg: Military history, Classical music), then we'll just end up with a list of drafts that nobody looks at. An affirmative action from the project will at least indicate that somebody is willing to look at drafts. Ritchie333 (talk) (cont) 10:23, 3 September 2014 (UTC)
Opt-in is what we've got currently. {{WikiProject Metal}} has opted-in to Draft-class and it's working fine as your two examples at the top will show. — Martin (MSGJ · talk) 10:41, 3 September 2014 (UTC)
I would also likely vote for option 2. — Martin (MSGJ · talk) 10:55, 3 September 2014 (UTC)
FWIW, I've developed a script User:Ritchie333/drafts.js that provides an option to list all unreviewed drafts assigned to a project, which allows me to bypass any template-based restrictions. Ritchie333 (talk) (cont) 11:50, 3 September 2014 (UTC)

I've started a discussion at Wikipedia:Village pump (proposals)#Widen usage of Draft-class. Any tweaks or suggestions welcome. — Martin (MSGJ · talk) 13:25, 3 September 2014 (UTC)

Autodetection of Redirect-class[edit]

I've found that when {{pagetype}} is used with a blank first parameter on the talkpage of a mainspace redirect, it outputs redirect - this has given me this idea, which should eliminate the need for edits like this. What do people think? --Redrose64 (talk) 20:01, 24 November 2014 (UTC)

Good idea! — Martin (MSGJ · talk) 20:14, 24 November 2014 (UTC)

Lua version[edit]

This is just a note to say that I've made a Lua version of this template at Module:Class mask. I've taken care to ensure that it's an exact one-to-one conversion - you can see the test cases at Module:Class mask/testcases (run). I've just tested the speed, and it turns out that it's actually slower than the existing template, although they're both very fast. (The template rendered 1000 transclusions in ~0.5 seconds, and the module rendered 1000 transclusions in ~1.0 seconds.) The difference is from the overhead involved in calling Lua from wikitext - when I tested the module in Lua only, it took ~0.03 seconds to render the result 1000 times. Because of the speed difference it wouldn't make much sense to convert the template now, but it might make sense if/when more of Template:WPBannerMeta gets converted to Lua. — Mr. Stradivarius ♪ talk ♪ 01:01, 19 January 2015 (UTC)