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 675:
:It looks okay on my browser, following the link you gave. I'll check on my mobile later &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:04, 20 January 2023 (UTC)
:[[File:Red information icon with gradient background.svg|20px|link=|alt=]] '''Not done for now:'''<!-- Template:EP --> per related discussion at [[Template_talk:Article_history#Remove_some_styles_to_improve_mobile_version|template talk:Article history]] [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 22:34, 25 January 2023 (UTC)
 
== Task force name and case sensitivity ==
 
Task force names, as processed by {{tl|WPBannerMeta/hooks/taskforces}}, seem case sensitive. If I have a WikiProject banner template with:
<nowiki>|tf 1 = {{{aviation|}}}</nowiki>
 
It seems that a talk page with <nowiki>{{WikiProject Military history|aviation=y}} </nowiki>, it'll get recognized, but <nowiki>{{WikiProject Military history|Aviation=y}}</nowiki> won't be.
 
Is there any way around this, other than :
<nowiki>|tf 1 = {{{aviation|Aviation|}}}}}}</nowiki>
 
?
 
The context for this is that I'm trying to create a WPBannerMeta version of the MILHIST talk page banner. Some of its task forces have 15+ parameters, so it would be nice to avoid needing to add multiple variations of capitalization for each TF parameter.
 
Would there be any ''downsides'' to changing {{tl|WPBannerMeta/hooks/taskforces}} to make these case-insensitive by default? That would be rather nice, and would help catch a lot of errors we couldn't possibly add to templates, like <nowiki>{{WikiProject Military history|aViation=y}}</nowiki>
[[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 12:40, 11 February 2023 (UTC)
 
:I don't know how you would do that, and currently the only way is <code><nowiki>|tf 1 = {{{aviation|Aviation|}}}}}}</nowiki></code>. Probaby something that could more easily be done when this template is converted to lua &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:38, 11 February 2023 (UTC)
::Lua is another thing frWiki beat us to; their banners have been Lua for a while. [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 22:01, 11 February 2023 (UTC)
::I'm also wondering if it's possible to replicate MILHIST's task force "headings" (like "General topics", "Nations and regions", "Periods and conflicts", see [[Talk:Acra_(fortress)]] for an example) with WPBannerMeta. Any ideas? [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 13:41, 12 February 2023 (UTC)
:{{replyto|DFlhb}} This cannot be done in {{tlx|WPBannerMeta/hooks/taskforces}} or any other template. Whilst it's easy to code for case-insensitive parameter ''values'', the MediaWiki parser always treats parameter names as case-sensitive. It has no means for overriding this other than by coding for each likely variant, which is why the existing template has code like <code><nowiki>{{{B-Class-1|}}}{{{B-1|}}}{{{B1|}}}{{{b-1|}}}{{{b1|}}}</nowiki></code>. This means that {{para|B-1}} is equivalent to {{para|b-1}}, similarly {{para|B1}} is equivalent to {{para|b1}}, ''but'' the lowercase form of {{para|B-Class-1}}, i.e. {{para|b-class-1}} is invalid because it's not explicitly coded for. Please show which task forces {{tq|have 15+ parameters}}. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 17:45, 11 February 2023 (UTC)
::Europe has 26. [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 22:02, 11 February 2023 (UTC)
:::No, {{para|European}} is the only alias for {{para|European-task-force}}. However, in addition, certain ''other'' taskforce parameters will trigger this one as a side-effect:
:::*{{para|Balkan-task-force}} (and its alias {{para|Balkan}})
:::*{{para|Romanian-task-force}} (and its alias {{para|Romanian}})
:::*{{para|Baltic-task-force}} (and its alias {{para|Baltic}})
:::*{{para|British-task-force}} (and its alias {{para|British}})
:::*{{para|Three-Kingdoms-task-force}} (and its alias {{para|Three-Kingdoms}})
:::*{{para|Dutch-task-force}} (and its alias {{para|Dutch}})
:::*{{para|French-task-force}} (and its alias {{para|French}})
:::*{{para|German-task-force}} (and its alias {{para|German}})
:::*{{para|Italian-task-force}} (and its alias {{para|Italian}})
:::*{{para|Nordic-task-force}} (and its alias {{para|Nordic}})
:::*{{para|Polish-task-force}} (and its alias {{para|Polish}})
:::*{{para|Spanish-task-force}} (and its alias {{para|Spanish|}}}
:::Each of these pairs is for a different traskforce, they are not aliases for {{para|European-task-force}}. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 23:14, 11 February 2023 (UTC)
::::I don't see what the difference is; everything in these task forces is supposed to automatically get tagged with the European TF too, so they're passed in to the Europe task force in addition to being based in for their own task force (in the sandbox version). Isn't that how it's supposed to be done? [[User:DFlhb|DFlhb]] ([[User talk:DFlhb|talk]]) 09:23, 12 February 2023 (UTC)
:::::See [[Template:WikiProject United States]] for an example of a WikiProject banner which is (a) built around {{tlx|WPBannerMeta}} (b) has lots of task forces (c) makes extensive use of parameter aliases, for example in this code: <syntaxhighlight lang=moin>|tf 2 = {{{USfilm|{{{UScinema|{{{USCinema|{{{USFilm|}}}}}}}}}}}}
|TF_2_LINK = Wikipedia:WikiProject Film/American cinema task force
|TF_2_NAME = WikiProject Film - American cinema task force
|TF_2_PORTAL = Film
|TF_2_IMAGE = United States film.svg
|TF_2_QUALITY = yes
|TF_2_IMPORTANCE = yes
|tf 2 importance={{{USfilm-importance|{{{UScinema-importance|{{{USFilm-importance|{{{USCinema-importance|}}}}}}}}}}}}
|TF_2_ASSESSMENT_CAT = American cinema articles
|TF_2_MAIN_CAT = American cinema task force articles
|TF_2_HOOK = {{WPBannerMeta/hooks/cats
|category={{{category|¬}}}
|BANNER_NAME = Template:WikiProject United States
|cat 1={{{auto|}}}
|CAT_1 = Automatically assessed American cinema articles
|cat 2={{{attention|}}}
|CAT_2 = American cinema articles needing attention
|cat 3={{{needs-infobox|{{{infobox-needed|}}}}}}
|CAT_3 = American cinema articles needing an infobox
|cat 4={{{needs-image|{{{image-needed|{{{photo-needed|{{{needs-photo|}}}}}}}}}}}}
|CAT_4 = American cinema articles needing an image
|cat 5={{{unref|}}}
|CAT_5 = Unreferenced American cinema articles
|cat 6={{{needs-geocoord|{{{geocoord-needed|}}}}}}
|CAT_6 = American cinema articles missing geocoordinate data
|cat 8={{Ifexist not redirect|{{FULLPAGENAME}}/to do|yes}}
|CAT_8 = American cinema articles with to-do lists
}}</syntaxhighlight> which has nine parameters, five of which have aliases - three have three aliases each. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 22:03, 12 February 2023 (UTC)