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

Content deleted Content added
m Archiving 1 discussion(s) from Template talk:WPBannerMeta) (bot
m Archiving 1 discussion(s) from Template talk:WPBannerMeta) (bot
Line 750:
 
Just to note that the new system is ready for implementation - probably tomorrow or the next day. Discussion of details has been going on at [[Template talk:WikiProject banner shell]]. Just to summarise: this template will be modified to sometimes suppress the display of the article rating (if it matches the rating given in the banner shell) but should otherwise be unaffected. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 23:00, 25 March 2023 (UTC)
 
== Automated NA importance ratings? ==
{{Archive top}}
Q. Is there a way to code a WikiProject banner so that a 'class' of, say, 'Redirect' or 'Category', automatically sets the 'importance' to 'na'? This would simplify our maintenance of the project's quality/importance table. Thanks. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 19:09, 19 February 2023 (UTC)
:It should already do that. Do you have any example where it does not. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 19:39, 19 February 2023 (UTC)
:: Sure: '[[Talk:Zeta UMi]]'. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 21:01, 19 February 2023 (UTC)
:::That is a redirect; real page is [[Zeta Ursae Minoris]]. [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 21:05, 19 February 2023 (UTC)
:::: Perhaps I'm not communicating my point. It's a redirect and ''does not need'' an importance rating. I want it to go to 'na', even if somebody set it to 'low'. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]])
:::::It will auto-assess as NA-importance if the importance is not specified, but you can override the default by using the parameter <!-- Template:Unsigned --><small class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:MSGJ|MSGJ]] ([[User talk:MSGJ#top|talk]] • [[Special:Contributions/MSGJ|contribs]]) 21:18, 19 February 2023 (UTC)</small>
:::::Generally speaking, unless the subject page is (i) an actual article; (ii) a list or (iii) a dab page, the {{para|class}} and {{para|importance}} parameters should be left blank or omitted entirely, they will then autodetect. For dab pages, you should set {{para|class|dab}}, leaving {{para|importance}} blank or omitted. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 23:23, 19 February 2023 (UTC)
:::::: Yes, I understand that. What I'm trying to avoid is having to repeatedly fix ratings where somebody added a redirect and set a non-NA importance rating. In this case it was a large quantity, so the result was a good chunk of unnecessarily wasted time. I was just hoping it was something I could code in the template logic, if somebody else had already addressed this. Thanks. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 00:02, 20 February 2023 (UTC)
:::::::It can be achieved but is it something all WikiProjects would be on board with? <span class="nowrap">&#8212;'''[[User:CX Zoom|CX Zoom]]'''[he/him]</span> <sup class="nowrap">([[User talk:CX Zoom|let's talk]] • {[[Special:Contributions/CX Zoom|C]]•[[User:CX Zoom/X|X]]})</sup> 06:04, 20 February 2023 (UTC)
:::::::: My thinking was it could be set with a configuration flag in this template. Alternatively, there could be some sample code or a macro that individual WP templates could substitute. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 16:55, 21 February 2023 (UTC)
::::: No, the misunderstanding was fully mine; I blame tiredness. Indeed, it would be nice if it could automatically override inaccurate importance ratings. It's tedious to have to clear those parameters manually. [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 23:25, 19 February 2023 (UTC)
:::::: No worries. Thanks. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 00:02, 20 February 2023 (UTC)
 
I did a little more investigating and came up with the following, which might serve for individual WP templates:
<syntaxhighlight lang="moin" line="1">
|importance={{#switch: {{lc:{{{class}}}}}
| category = na
| redirect = na
| file = na
| portal = na
| redirect = na
| template = na
| #default = {{{importance|}}}
}}
</syntaxhighlight>
I don't know how to test it though. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 16:50, 21 February 2023 (UTC)
:The point about autodetection is that you ''don't'' set class except for true articles, lists and dab pages, so for categories, redirs etc., i.e. pages where {{para|class}} isn't set, the above resolves to <syntaxhighlight lang="moin" line="1">|importance={{{importance}}}</syntaxhighlight> which is an invalid value. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 22:04, 21 February 2023 (UTC)
:: That resolution is the same as the current setting, so how is that invalid? Anyway, the scenarios of concern are those where autodetect is overridden. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 23:48, 21 February 2023 (UTC)
:::It's invalid because when the {{para|importance}} parameter is not fed in, the value <code><nowiki>{{{importance}}}</nowiki></code> is taken literally. If you want an absent parameter to resolve to a null value, you need to add a pipe before the closing triple brace. It's also ''not'' the same as the current setting, which uses code to determine the namespace, see [[Template:Importance mask]] and [[Module:Pagetype]]. I also don't see why we would need to write new code for this, when we already have code that has existed for years, is thoroughly tested and extensively used. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 00:38, 22 February 2023 (UTC)
:::: Okay, pipe added. Well I've experienced this issue for a year now, so I'm looking for a solution and I was hoping this might be a good spot to start. I see there's no point in continuing. [[User:Praemonitus|Praemonitus]] ([[User talk:Praemonitus|talk]]) 03:28, 22 February 2023 (UTC)
{{Archive bottom}}
{{ping|Praemonitus}} if you use a custom importance mask, your project can manage its importance ratings however they wish. Let me know if you need help setting this up. Or if you think this is something every project should have, then do continue to discuss here. [[Template:Class mask]] has a |forceNA setting - we could look at adding such a thing to [[Template:Importance mask]] also &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 20:46, 28 March 2023 (UTC)