Extension talk:Popups/2022

Latest comment: 2 years ago by Thiemo Kreuz (WMDE) in topic Inline references


When asking a question about a preview not displaying please ensure to include information on the wikitext of the first section of the target page (markup before first heading double equals signs) and the network request.

Reference Feature in MediaWiki 1.36.1

edit

So, i want to add Reference Preview feature on my local wiki, so i can hover the reference number and directly see the full reference via the popups.

In MediaWiki 1.36.1 , PageImages and TextExtracts folder is already exist on extension folder (but not yet activated on LocalSettings.php). So we dont have to download both of them anymore.

All we have to do is to download the "Popups", store it on extension folder, go to LocalSettings.php , then add

wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'Popups' );
$wgPopupsReferencePreviewsBetaFeature = false;


For some reason, if we dont include "$wgPopupsReferencePreviewsBetaFeature = false;" , the reference previews dont work at all. Ctify (talk) 10:02, 10 January 2022 (UTC)Reply

This extra line is only relevant if you use Extension:BetaFeatures. This is meant to be temporary and will go away some day, but is currently needed if you want to enable the feature for all users. Just keep the line and you should be fine. Thiemo Kreuz (WMDE) 10:30, 10 January 2022 (UTC)Reply

Hard dependencies?

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Extension:Popups#Dependencies says:

This extension has a hard dependency on Extension:TextExtracts and Extension:PageImages

But looking at the code...

/**
 * @return bool
 */
public function areDependenciesMet() {
   if ( $this->config->get( 'PopupsGateway' ) === 'mwApiPlain' ) {
      return $this->extensionRegistry->isLoaded( 'TextExtracts' )
      && $this->extensionRegistry->isLoaded( 'PageImages' );
   }

   return true;
}

It seems they're only hard dependancies in a certain config mode? Reedy (talk) 01:25, 30 January 2022 (UTC)Reply

Seems like it. You can use a custom popups gateway. Maybe we should amend the documentation? Tinss (talk) 01:30, 30 January 2022 (UTC)Reply
Indeed. Though, in default config of $wgPopupsGateway (which is mwApiPlain), those extensions are needed...
Definitely room for improvement here in the documentation :) Reedy (talk) 01:37, 30 January 2022 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

ext.popups was loaded but everything is disabled

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Using the master branch an MW 1.35.5, I get this error. Nothing has been disabled, the extension used to work when I was using MW 1.34.

Any idea what's going on? Tinss (talk) 01:33, 30 January 2022 (UTC)Reply

Found the problem. The configuration has changed, set this in LocalSettings.php:
$wgPopupsHideOptInOnPreferencesPage = true;
$wgPopupsReferencePreviewsBetaFeature = false;
Tinss (talk) 01:33, 30 January 2022 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Bold text not showing on popup

edit

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Hello! I'm having a slight issue with the popups extension.

I've recently started my own private MediaWiki to test out some features and extensions, and it seems that some popups are not showing any bold text from the respective page its popup is giving a brief summary about. It's all just plain text. Need I mention, the bold text I'm trying to get on the popup is not the title of the page.

This left me very stumped. I tried looking for ways to possibly fix it, but there aren't many tutorials on how, and my inability to properly work with code on my own doesn't help all that much either. Is there any way to go about this? MrPizzaWiki (talk) 17:35, 17 February 2022 (UTC)Reply

After diving into the code, it looks like the extension is always requesting plain text extracts from Extension:TextExtracts (parameter "explaintext"). While you coyld manually edit Popups/resources/dist/index.js and change explaintext:!0 to explaintext:!1, I probably wouldn't go down that road because of maintainability.
However, Wikimedia themselves went with their own Page Content Service API instead of TextExtracts, and when that's used as the gateway for Popups it shows HTML and not plaintext (e.g. [1]). It's unclear how (and if it's possible at all) to install the Page Content Service, so I don't really see a good solution here. FFS Talk 13:22, 21 February 2022 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Reference types "note"?

edit

At Extension:Popups#Reference types also note is listed as a type. But when I use <ref><cite class="note">This is a note.</cite></ref>, I still get a popup with the title Reference. What can I do to have a popup title Note?

Jorges (talk) 00:59, 30 April 2022 (UTC)Reply
There shouldn't be anything special about this type. When I try it on e.g. English Wikipedia it works, so I guess you are working with a different wiki? Thiemo Kreuz (WMDE) 17:27, 1 May 2022 (UTC)Reply
Yes, I work with a different wiki, one that I administer myself. It was also me who installed this extension, so maybe I've made a mistake. See here a sandbox example. Jorges (talk) 21:20, 3 May 2022 (UTC)Reply
That helps, thanks. While I can't access Special:Version, I can see that this is an older version of the Popups extension from before February 2021 when the relevant change was made. Thiemo Kreuz (WMDE) 06:59, 4 May 2022 (UTC)Reply

Only text in Popups

edit

I can see the picture while editing the link, but after editing the popup is only text in preview and there is no last edited time shown next to the gear icon.

MediaWiki Version: 1.37.2

Is there any configuration I'm missing? SaltyMolaontheMoon (talk) 16:59, 15 June 2022 (UTC)Reply

Some Page Popups do not show anymore after upgrading to mediawiki-1.37.4

edit

We use mediawiki to order our cooking recipes since 2019. I upgraded recently from mediawiki 1.35.1 to 1.37.4. Since then the Popups (using https://www.mediawiki.org/wiki/Extension:Popups – (2c2c6d3) 07:04, 26. Jul. 2022) of some pages are displayed.

For many other Pages I get a popup window which gives the error message "Es gab ein Problem bei der Anzeige dieser Vorschau", which basically says: "There was an issue displaying this preview". Any ideas? 964C2 (talk) 08:15, 26 August 2022 (UTC)Reply

I'm probably not of much help here, but is it possible that your version of the extension is too recent? Maybe give the REL_1.37 branch a try. Cavila 09:20, 26 August 2022 (UTC)Reply
I used the download for the 1.37 branch. Maybe the download the date of the extension add just the latest build for this release? 964C2 (talk) 16:05, 26 August 2022 (UTC)Reply
What you did sounds about right. In the past, some users have been experiencing issues with the ExtensionDistributor, in which case you may better off getting the 1.37 branch directly from Github. I don't know if the extension's reliance on dependencies has changed in the interim. Another issue could be the need to rebuild page cache (does the popup work again after a refresh of the source page?), but other than that I have no idea. Cavila 17:02, 26 August 2022 (UTC)Reply
Did a rebuildall.php, which did not help. I am not familiar with git, so I have no idea how to install the 1.37 branch from github.
It seems, that on those pages, where the problem exists, in ui/renderer.js in the function createPreviewWithType the default case is processed. Strange thing: for some the preview works, for others not.
Any developers here who can maybe help? Don't know how to debug in this case ...
----ui/renderer.js:
export function createPreviewWithType( model ) {
switch ( model.type ) {
case previewTypes.TYPE_PAGE:
return createPagePreview( model );
case previewTypes.TYPE_DISAMBIGUATION:
return createDisambiguationPreview( model );
case previewTypes.TYPE_REFERENCE:
return createReferencePreview( model );
default:
return createEmptyPreview( model );
}
}
@Cavila: Thank you for your help so far. Forgot to thank you, sry ... 964C2 (talk) 10:15, 28 August 2022 (UTC)Reply
This sounds like an issue with Extension:TextExtracts, not Extension:Popups (the error usually shows when the API doesn't provide something usable). Extension:TextExtracts#Caveats might have some clues. Jdlrobson (talk) 14:08, 30 August 2022 (UTC)Reply
@Jdlrobson Meanwhile I updated to 1.37.6 an the effect remains.
I read in the documentation to Extension:TextExtracts, that there is an API to test and tried it out.
http://kochwiki/api.php?action=query&format=json&prop=extracts&titles=Aioli&exchars=175 (a local wiki) results in:
Unfortunately I cannot paste code here, so I add just one line from the result of the call:
"extract": "<h2><span id=\"Zutaten\">Zutaten</span></h2>\n<ul><li>1 Ei (wenn direkt aus dem Kuehlschrank, aufschlagen und etwas erwaermen lassen)</li>\n1 TL Zitronensaft</li></ul>"
Does this show, that the TextExtract Extension does extract the text correctly? I think so, or?
When you try to preview the page "Aioli" you get the error message: "There was an issue displaying this preview"
Is it probably nevertheless a problem with Extension:Popups?☁ 964C2 (talk) 13:29, 16 November 2022 (UTC)Reply

Image size requirement

edit

Extension:Popups#Known problems says:

for a portrait image: exact (min) height 250 px & max width 203 px; for a landscape image: exact (min) width 320 px & max height 200 px[1]. To display, images must be able to become a thumbnail that is larger or equal to these "exact" sizes.

That is very convoluted and hard to interpret. Does "max" have anything to do with maximal? Maybe it uses language which corresponds closely to how the code is written but users have no need for such complications. I suspect the actual rule is simply something like this:

width × height must be either at least 320 × 200 px or 203 × 250 px.

If that is the rule then can the documentation please just say that?

PrimeHunter (talk) 12:24, 29 August 2022 (UTC)Reply

Inline references

edit

Does this extension only works with inline references? In my wiki references pop-up only when they are inline surrounded by ref /ref tags. Recently we moved to eliminate inline references because they are quite a mess to deal with and we have very simple calls to references at the buttom of the page without using ref tags. Cojoilustrado 07:16, 3 November 2022 (UTC)

I'm afraid you have to explain what you mean or show an example. References can be at the bottom of the page, see Help:Cite#Separating references from text. When you made something else without using <ref> tags there is hardly any way the Cite and Popups extensions can be aware of it. It might be possible to recreate the HTML and CSS classes so Popups can still find it. But why not just use <ref>? Thiemo Kreuz (WMDE) 07:31, 3 November 2022 (UTC)Reply
I created citation templates to standardize citations and avoid the ugly cluttering that inline references create in the source of articles. They can really make it difficult to read or edit. So in the text, I include {{re|1}}, for example, and at the bottom, another template displays the citation, {{rf|1|url=xxx|title=xxx|publication=xxx}}. This is an example Aquiles Nazoa - La Venciclopedia
These templates really clean up the source of URLs and whatnot, but now I realize my mistake. I tried the option provided in your link (thank you very much), which I didn't know, but the <ref name="xxx" /> method of moving citations to the bottom doesn't work either with the Popup extension. Cojoilustrado 09:54, 29 November 2022 (UTC)
I'm not sure why you say this. <ref name="xxx" /> works fine with Popups. Thiemo Kreuz (WMDE) 10:39, 29 November 2022 (UTC)Reply
I just realized this might be an Edge issue. <ref name="xxx" /> popups work well in Chrome. Cojoilustrado 23:51, 5 December 2022 (UTC)
Maybe it's my wiki. I tested it in my sandbox and it doesn't seem to work. You can check it out here. Venciclopedia:Zona de pruebas - La Venciclopedia Cojoilustrado 23:47, 5 December 2022 (UTC)
Return to "Popups/2022" page.