Don't displayed images from infoboxes, please hepl to fix this.
Extension talk:PageImages
in extension.json try higher numbers for the first position --> in config --> PageImagesScores -> value -> position.
i want the images of infoboxes to be a page image and it seems working well with these settings:
"position": [
100,
-100,
-100,
-100
],
Its work, but I use PortableInfobox, and PageImages chose images from templates in infobox, but not the main image. How fix it?
Replying here as well as Topic:W30ufufmhj50l9h8 to report the same issue, PageImages seems to completely break when PortableInfobox is used.
Can report the same issue. PageImages can't seem to extract images from the topmost <image> of a PortableInfobox.
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 {{}}?
- You could add a parameter to the infobox template that does that.
- Same.
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.
How do I exclude a page from having a page image?
You can mark all potential page images on the page with |class=notpageimage
per Extension:PageImages#Can I exclude certain page images?
Is there really no other way? Since I would want to do that for the main page of a wiki, which is wholly comprised of templates, and the images in it may change from time to time.
In the MediaWiki instance I manage, PageImages produces multiple og:image tags, and in some websites, they all get picked up. Is there any way to make the extension consider only the first image and produce a single og:image tag?
Looks like it's currently not possible
I'm running the following API call: /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower to return a list of articles in the "Flower" category.
With the information in Extension:PageImages#API, since this is using the query action, I can get a list of pageimage information by adding "prop=pageimages" to the url to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix&cmnamespace=0&cmtitle=Category:Flower&prop=pageimages
I was expecting the pageimages for each of the pages but the results didn't change.
Since I had an existing "cmprop" parameter, I also tried adding it there to make /w/api.php?action=query&list=categorymembers&cmprop=title|sortkeyprefix|pageimages&cmnamespace=0&cmtitle=Category:Flower but that didn't change anything either.
Am I able to change the url to get the pageimage information for all the pages in the category?
You need to use categorymembers as a generator, instead of list, because otherwise you are be requesting the pageimage information from the category instead of the members
Thanks, that worked perfectly!
Does PageImages ignore or somehow miss images that are included in a page through translusion via a template?
I've adjusted the "ratio" scores in extension.json such that the ratios of image sizes I normally have are scored positively. But with that update, after re-saving the page, I still can't get &action=info to show me any "page image" property on many of my pages, on pages using templates to write infoboxes, the same the way I can when images are simply included using normal Wikitext.
Is using a template to write the image to the page my problem? Thoughts? Workarounds? Thanks.
Images included through transclusion of templates work fine for PageImages.
I am running into the same issue. Almost every page on my wiki that uses a template powered by Extension:PortableInfobox refuses to select a page image. It doesn't even select another image from the page; it just doesn't select any at all. This is causing Popups/Page Previews to fail for almost every page with a Portable Infobox.
Maybe Extension:PortableInfobox is the culprit here. I can assure including images from templates works fine. Example.
Hello! How to get the list of all pages on wiki that don't have pageimage?
One way is via a Quarry query such as this one. Registered users can fork the query and adjust it to their wishes.
Hi, On our wiki, a lot of our images are 150 x 150 images, and we'd like to get these considered to be page images for articles.
I've looked at the setting for width, but I'm not sure exactly what kind of scoring I should set for that. Would something like this work?
$wgPageImagesScores['width']= {
"119": -100,
"150": 11,
"400": 10,
"600": 5,
"601": 0
};
Images down to 120px are allowed by default. Your code only makes a difference if you prefer 120-150px against more than 150px on pages with multiple images. I didn't find any page with a page image in your wiki, and https://buttonmen.miraheze.org/wiki/Main_Page has a 300px image. https://buttonmen.miraheze.org/wiki/Special:Version says PageImages is installed. Have you run "initImageData.php" per Extension:PageImages#Installation?
Page Previews rejects some small images which have been selected as page image: Extension:Popups#Known problems. Topic:X24ym9nooumpgr1h tries to state the requirement more clearly. There is an example here: How come some images show up while hovering on some articles and on others they do not? Popups is a different extension but it's a prominent use of PageImages and can confuse users so I suggest a brief mention here, maybe my opening sentence.
It shows up in Special:Version
https://mysterydungeonwiki.com/wiki/Special:Version
I've added "$wgPageImagesNamespaces" along with a list of all of my wiki's custom namespaces and it's not working.
https://mysterydungeonwiki.com/wiki/Shiren:Blacksmith?action=info
I've ran "cd w/maintenance /php update.php". and refreshLinks.php and that didn't seem to do anything. I'm out of ideas
https://mysterydungeonwiki.com/wiki/Special:AllPages shows mainspace pages. It works there, e.g. https://mysterydungeonwiki.com/wiki/Mystery_Dungeon_Wiki/Latest_Game?action=info
It's only enabled in mainspace by default. What is your code for $wgPageImagesNamespaces? Do you have evidence that other code in the file is used?
> wfLoadExtension( 'PageImages' );
> $wgPageImagesExpandOpenSearchXml = true;
> $wgPageImagesLeadSectionOnly = true;
$wgPageImagesNamespaces = array( -1 => 0, 0 => 1, 1 => 0,
2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 3000 => 0, 3002 => 0, 3004 => 0, 3006 => 1, 3008 => 1,
3018 => 1, 3020 => 1, 3022 => 1, 3024 => 1, 3026 => 1, 3028 => 1, 3030 => 1, 3030 => 1, 3032 => 1, 3034 => 1, 3036 => 1, 3038 => 1,
3040 => 1, 3042 => 1, 3044 => 1, 3046 => 1, 3048 => 1, 3050 => 1, 3052 => 1, 3054 => 1, 3056 => 1, 3058 => 1, 3060 => 1,
3062 => 1, 3064 => 1, 3066 => 1, 3068 => 1, 3070 => 1, 3072 => 1, 3074 => 1, 3076 => 1, 3078 => 1, 3080 => 1, 3082 => 1,
3084 => 1, 3086 => 1, 3088 => 1, 3090 => 1, 3094 => 1, 3096 => 1, 3098 => 1, 3100 => 1, 3102 => 1, 3104 => 1, 3106 => 1,
3108 => 1, 3110 => 1, 3112 => 1, 3114 => 1, 3116 => 1, 3118 => 1, 3120 => 1, 3122 => 1, 3124 => 1, 3126 => 1, 3128 => 1,
3130 => 1, 3132 => 1, 3134 => 1, 3136 => 1, 3138 => 1, 3140 => 1, 3142 => 1, 3144 => 1, 3146 => 1, 3148 => 1, 3150 => 1,
3152 => 1, 3154 => 1, 3156 => 1, 3158 => 1, 3160 => 1, 3162 => 1, 3164 => 1, 3166 => 1, 3168 => 1, 3170 => 1, 3172 => 1,
3174 => 1 );
I also tried the following, which didn't work.
$wgPageImagesNamespaces[] = 3036;
Try to merely list the wanted namespaces: array(0, 3006, 3008, ..., 3036, ...)