Jump to content

Topic on Extension talk:PageImages

Exclude infobox image from page images

3
Borisenko-ru (talkcontribs)

I`ve got two questions related to the algorithm work for infoboxes:

1. How do I exclude specific infobox image with class=notpageimage if it comes from wikidata (it is used in other languages wikis' infoboxes)? The only way is to delete the image on wikidata page (from the "Image" section). But what if I want to leave it on wikidata and just apply class=notpageimage to let the algorithm choose another picture as page image.

2. How do I exclude specific infobox image with class=notpageimage if the image file name is not in square brackets [[]] but the part of infobox template {{}}?

Bdijkstra (talkcontribs)
  1. You could add a parameter to the infobox template that does that.
  2. Same.
PrimeHunter (talkcontribs)

An image is still displayed with image code like [[File:Example.png]] if the image is taken from wikidata and added by an infobox. The infobox generates the image code and could add an optional parameter to instead say [[File:Example.png|class=notpageimage]]. A more hacky solution is to use the local Special:ExpandTemplates to see the precise code generated by the infobox and then wrap the whole infobox call in a string function which changes the image code to add |class=notpageimage. If the wiki has Module:String then Module:String#replace can be used. It's not pretty and may be unstable if changes are later made to the infobox.

Reply to "Exclude infobox image from page images"