Template talk:Main page image

Latest comment: 15 days ago by Sohom Datta in topic Protected edit request on 12 August 2025

Protected edit request on 22 October 2021

edit

Update from sandbox: Special:Diff/1051326333. This swaps out the nested template approach for a direct call to {{#invoke:string|replace}}. The reason for this is both general code simplification/modernization, and to avoid spreading cascade-protection out to templates that would not otherwise be protected. (In particular, the second reason is why the equivalent {{replace}} is not used.) This has been tested in the testcases page; the original tests were adequate to test this feature, but I have updated them to use Template:Test cases which verifies that there is no change at all to output for the tested inputs. User:GKFXtalk 10:59, 23 October 2021 (UTC)Reply

Update: please instead copy Special:Permalink/1052352524 to Template:Main page image, and also copy Special:Permalink/1052354348 to Template:Main page image/DYK. This includes the edit request above, and also fulfils the feature request below. User:GKFXtalk 18:19, 28 October 2021 (UTC)Reply
  Done — Martin (MSGJ · talk) 22:18, 31 October 2021 (UTC)Reply

Thumbtime

edit
[[File:|140px|Hacky way ]]
Hacky way
Normal size without thumbtime hack

I'm submitting a DYK nomination with a video, and I'd like to use the thumbtime parameter to give it a better image. Doing that in a hacky way seems to affect the size, though. {{main page image/DYK|image=Money Musk at Youth Dance Weekend 2019.webm{{!}}thumbtime=60|caption=Hacky way}} results in the smaller image at right, compared to the normal-sized one beside it. I'm not sure why that's happening, but could a |thumbtime= parameter be added to (hopefully) resolve it? Cheers, {{u|Sdkb}}talk 17:44, 28 October 2021 (UTC)Reply

Done in sandbox and tested at testcases page. Please could an administrator copy both changes to the main templates? User:GKFXtalk 18:15, 28 October 2021 (UTC)Reply

Lua errors

edit

Please can you make it fail gracefully when the image parameter is blank. I know it is not supposed to be used without an image specified but sometimes a bot comes along and removes the image. See Template:Did you know nominations/Fredericka Martin. Thanks — Martin (MSGJ · talk) 19:56, 4 November 2021 (UTC)Reply

@MSGJ: I have made an edit request at Module talk:Main page image. User:GKFXtalk 23:33, 4 November 2021 (UTC)Reply
Thank you — Martin (MSGJ · talk) 05:59, 5 November 2021 (UTC)Reply

Dark mode fixes

edit

Implement change in sandbox, which explicitly defines text color with a CSS variable to support dark mode. Snowmanonahoe (talk · contribs · typos) 22:11, 20 May 2024 (UTC)Reply

Ah, not a color variable. Didn't notice the edit made just after mine. Seems to work anyway. Snowmanonahoe (talk · contribs · typos) 22:13, 20 May 2024 (UTC)Reply
So you don't need a change or you do? — xaosflux Talk 12:37, 21 May 2024 (UTC)Reply
@Xaosflux A change is definitely needed here since the current situation is suboptimal (the image caption is rendered as black text on a black background). Please sync Template:Main page image/sandbox to Template:Main page image. Thanks. Sohom (talk) 13:08, 21 May 2024 (UTC)Reply
@Sohom Datta give caching a few mins and try. — xaosflux Talk 13:15, 21 May 2024 (UTC)Reply
  Donexaosflux Talk 13:15, 21 May 2024 (UTC)Reply
Works :) Sohom (talk) 13:38, 21 May 2024 (UTC)Reply

Dark mode for transparent images

edit

For Wikipedia:Today's featured article/August 6, 2024, it wouldn't hurt to be able to add |class=skin-invert-image for File:Existential quantifier.svg, with something like this: Special:Diff/1224947685/1239007348. See Template:Main page image/testcases#Dark mode test. Or is |class=skin-invert correct in such cases? —⁠andrybak (talk) 21:11, 6 August 2024 (UTC)Reply

Accessibility issue: alt text

edit

From discussion at Talk:Main Page#Accessibility: We could so do much better, it seems that this template is added in the default image caption (from structured data) as alt text.

This is bad practice. Alt text should describe the image to people with a visual impairment, or who cannot see it for some other reason. It should not repeat what is in the visible caption.

Please can this behaviour be removed from the template?

It might be best if the template displays a red warning, linking to WP:Alt text, if alt text is not entered manually.

Other than technical matters, I suggest that discussion be centralised at the link in my opening paragraph. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:12, 2 December 2024 (UTC)Reply

Protected edit request on 12 August 2025

edit

Please add a class parameter to this template so that images that need to be inverted in the dark mode can make use of skin-invert, ideally by replacing

<!--end #if for link-->{{#if:
{{{thumbtime|}}} | {{!}}thumbtime={{{thumbtime}}} }}

By

<!--end #if for link-->{{#if:
{{{thumbtime|}}} | {{!}}thumbtime={{{thumbtime}}} }}<!--end #if for thumbtime-->{{#if:
{{{class|}}} | {{!}}class={{{class}}} }}

I needed this in Persian Wikipedia so applied this for this page but as I suspect someone will clean update the template from English Wikipedia version in the future thought it might be better to propose the change to English Wikipedia also. −Ebrahimtalk 15:31, 12 August 2025 (UTC)Reply

  Done Sohom (talk) 16:21, 13 August 2025 (UTC)Reply
@Sohom Datta: you've forgotten two closing braces when implementing, those to go along with the {{#if: {{{class|}}}|. Apparently Remex fixes that problem backstage, but Parsoid leaves it (phab:T401860). Nevermind, Izno took care of it.Alien  3
3 3
19:55, 13 August 2025 (UTC)Reply
Ooh, my bad :( Sohom (talk) 20:03, 13 August 2025 (UTC)Reply