The Extension works fine and I'm very happy with it. The question now is how to trigger the Plugin on all Articles. At the moment only images are shown after I changes an Article.
Is there a way to trigger LinksUpdate on all Articles manually?
The Extension works fine and I'm very happy with it. The question now is how to trigger the Plugin on all Articles. At the moment only images are shown after I changes an Article.
Is there a way to trigger LinksUpdate on all Articles manually?
Hey, it is possible to do it manually. I am currently having MediaWiki 1.31.
To manually trigger this for all articles you have to start the initImageData.php in extensions/PageImages/maintenance/ folder. I do not have shell/ssh support on my provider, so I had to use MaintenanceShell extension and change the $wgMaintenanceShellPath to the mentioned path.
It looks like there is also some problem (at least on my server) with the script and I couldnt get it work properly. After some debugging I saw that I had to change LinksUpdateHookHandler.php (in PageImages/includes/) the following:
$rev = $linksUpdate->getRevision();
with:
$rev = Revision::newFromTitle($linksUpdate->getTitle());
And I managed to get all images on preview (using the Popups/PagePreviews extension)
Hope it helps someone
I received the below warning when running initImageData.php. It seems to have worked fine, but a note should be added on the Configuration section explaining how to use maintenance/run.php (or if it's safe to simply ignore this warning).
C:\inetpub\wwwroot\mediawiki\extensions\PageImages\maintenance>php initImageData.php ******************************************************************************* NOTE: Do not run maintenance scripts directly, use maintenance/run.php instead! Running scripts directly has been deprecated in MediaWiki 1.40. It may not work for some (or any) scripts in the future. ******************************************************************************* 35 done
I'm not sure if this needs to be updated in the extension code itself.
We should probably just hook the maintenance script up to update.php like most extensions do?
Have quickly written https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageImages/+/1064129 but not tested it yet.
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 {{}}?
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.
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?
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
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?