Page MenuHomePhabricator

Wrong web preview priority with a header created with a template & templatestyles
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Susannaanas
Jun 27 2025, 2:50 PM
Referenced Files
F62604292: image.png
Jun 27 2025, 2:50 PM
F62604232: image.png
Jun 27 2025, 2:50 PM
F62604257: image.png
Jun 27 2025, 2:50 PM

Description

Steps to replicate the issue (include links if applicable):

  • When creating pages on Meta with a popular template and templatestyles (initially created for Wiki Loves Living Heritage and versioned for different purposes) the image in the header part of the page does not necessarily display as the web preview image.

What happens?:

What should have happened instead?:

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

image.png (1×2 px, 264 KB)
image.png (626×794 px, 133 KB)
image.png (620×696 px, 160 KB)

Event Timeline

A_smart_kitten subscribed.

It looks like the PageImages extension is selecting that image (i.e., the sponsor logo) to be the 'page image'. (cf. https://meta.wikimedia.org/w/index.php?title=Wikipedia_on_Aruba&action=info#mw-pageimages-info-label)

I don't know what exactly is causing the extension to score that image highly (and so I'm not sure whether there's a bug here or not); but a couple of suggestions in case they help to resolve the immediate problem:

  • If the image in Template:Wikipedia on Aruba/Main navigation should be the 'preview image' for every page that template's included on, you can add the pageimage class to that image; which (hopefully!) might force that image to be selected. (documentation)
  • Alternatively, if the images in Template:Wikipedia on Aruba/Footer should never be the 'preview image' for the pages that template's included on, you can add the notpageimage class to each of those images, which should hopefully exclude those images from being selected. (documentation)

Let me know if I've worded anything poorly and/or if you have any queries!

Thank you, adding the pageimage class seems like the best option to use in the header template all over Meta. I wonder how to force it to replace an already created preview image?

It might be automatic (potentially after a little bit of time); to be honest, I'm not personally sure about that though.
If not, the documentation suggests (in two different places) that either making an edit to the page (doc) or adding/removing a link from the page (doc) should force its image to be updated.

Thank you so much for the help! I have made some edits and changed links. I hope the preview gets updated, but so far I have not observed changes. The change may also be hard to verify! Fingers crossed :-D

I hope the preview gets updated, but so far I have not observed changes.

Ahhh, I think I might have worked out why - it looks like the class is being applied to the surrounding <div>, rather than to the image itself :-)
I've made an edit to the template - hopefully things might work as intended now! 🤞

(edit: after also making a null edit to Wikipedia on Aruba, it looks like the page image is now what it should be :D)

Susannaanas claimed this task.