Module talk:Vital article

Latest comment: 4 days ago by Zar2gar1 in topic Possible tweaks?

Not working on numbers

edit

The template currently does not properly work on numbers. {{VA link|0}} produces only 0   3 even though 0 is a level-3 article. Similarly, there are problems with 1   4 and 2   5. @MSGJ: I guess a similar problem might arise in {{WPBS}} as well. I don't have time to work on it right now, but I am guessing this might be caused by JSON to Lua-array conversions. --Kammerer55 (talk) 07:27, 8 December 2023 (UTC)Reply

I didn't reply but I notice this is working now — Martin (MSGJ · talk) 09:24, 13 June 2024 (UTC)Reply

Should this template work in article space?

edit

This template appears to function as documented in article space. Is there any reason that should be the case? I recommend adjusting it with {{main other}} or other namespace detection so that it generates a plain wikilink in article space. – Jonesey95 (talk) 23:24, 9 December 2023 (UTC)Reply

It was never supposed to be used in article space. I've just added a few warnings and explanations to the documentation to address this concern. I do not want to overcomplicate the template with extra-checks for now, but probably such checks could be added to the Lua-code in the future if the need arises. Kammerer55 (talk) 22:06, 10 December 2023 (UTC)Reply

Possible tweaks?

edit

Hi there, especially since VA link is more of a programmatic template, I thought I should discuss things instead of just trying changes. I had an idea though for the edit-summary issue; it involves a few steps (listed in order of requirement, not implementation), but I don't think they're especially complex.

Step 1: it looks like people are pretty fond of using the VA link template in headers on Talk page discussions. So we don't want to just discourage that. If we could add WP:SAFESUBST to the template here, then indicate that the template should be substituted when used in headers or anchors, the anchors will be stable with working links.

Step 2: in its current form, substituting the template would inject the file-link to the VA target icon into everything. AFAICT, providing alt text for the icon link doesn't change that either. Setting aside the icon for the moment, what if the Lua module instead injected a very simple, relatively unambiguous, plaintext marker? I'm thinking something like "VA §"

Step 3: we move the link for the VA target icon into a user JS file, where it will substitute for the plaintext "VA §" marker on the browser. We can even add a couple checks, like disabling the substitution on pages in article namespace.

The main downside I see is the inconvenience of custom JS for those that like the icon. The non-substituted template also does serve as a small check for proposals on the VA project (if the number changes, you know you updated the list). But if someone likes that, they can always put the transcluded template in the discussion body.

The positives OTOH are not only that we fix the anchor issue, but we also give those that don't like the icon an option. I'm not sure it would make much difference as long as the icon has alt text, but the plaintext marker could also help out with things that aren't as visual (screen-readers, bots, text-based browsers, etc.) -- Zar2gar1 (talk) 16:08, 27 November 2024 (UTC)Reply

Actually, I just realized I could spin up a second template that invokes the Lua module in a substitution-friendly way. I'll work on this idea in parallel, and down the road, we can consider deprecating one template, then merging them. -- Zar2gar1 (talk) 18:30, 29 November 2024 (UTC)Reply