Guild Wars 2 Wiki:Popups
Popups are provided by the Popups extension, and provide page previews when hovering over any wiki link. They can provide a quick reminder of what a sentence is talking about without having to visit the page and return to it, speeding up the browsing experience of using a wiki.
This page serves to document any quirks of setting up the popups.
- Extension:Popups — draws the box, requests images and text from the info API.
- Extension:PageImages — API enhancement to allow a likely main image to be extracted.
- Extension:TextExtracts — API enhancement to allow the first few sentences to be extracted.
List of helper templates
- Template:Wikipopup — a wrapper template applying the CSS class
- Template:Wikipopup prefix — a plaintext variant to Template:Prefix attributes for Armor, Back item, Trinket and Weapon infoboxes.
- Template:Wikipopup upgrade — a plaintext template to display upgrade and infusion slots for Armor, Back item, Trinket and Weapon infoboxes.
- Template:Wikipopup quotation — quotation source, e.g. " — In-game description"
- The most likely image to be extracted by the extension PageImages is one of the first four images in an article which has a major dimension (either width or height) between 400-600px, and the major dimension is approximately twice the value of the other minor dimension, 200-300px. The extracted page image can be found in the Basic information section in "Page information" (in the right tool bar or by appending
?action=infoto the URL of any page).
- Images with a ratio (width/height) of 0.4 to 3.1 are allowed, while images with a ratio of 0.6 to 2.1 are preferred. This means that a first listed image with an allowed but not preferred ratio (e.g. 0.5) might not be weighted over a second listed image with a preferred ratio (e.g. 1).
- The extension Popups, using the extracted page image in the preview, distinguishes between two image types:
- Portraits (height > width) are displayed to the right, and have the maximum width of 203px and the exact height of 250px. As an example, hover the following link: Eir Stegalkin.
- Landscape (width > heigth) are displayed above, and have the exact width of 320px and the maximum height of 200px. Example: Kiriel Rock.
- This means that portrait images with a height less than 250px and landscape images with a width less than 320px are not displayed in the page preview even if they have been extraced by the page images extension.
- Popup information is cached, so if you edit an article the preview of the page will not update immediately, even after updating the wiki cache of both pages and clearing your own cache. You just need to wait (or you can edit the page and add/remove a link - since this is the only time the image is recalculated).
- There is a blacklist page available - each image to avoid using must be separately linked on MediaWiki:Pageimages-blacklist.
- By default the following element types are excluded:
- By default the following element classes are excluded:
- This means, for example, that text can be intentionally excluded with the class
- The template Template:TOCright seems to inconsistently block the TextExtracts for unknown reasons, while sometimes after purging the page it works fine, soon afterwards it "forgets" the extracted text again. This can be avoided by placing the template below the first paragraph.
- Special:Version lists the currently installed versions of Extension:Popups, Extension:TextExtracts and Extension:PageImages.