Topic on Extension talk:TextExtracts

STEM (talkcontribs)

Adding on my wiki 1.35.2 on IIS 10 but does not seem to strip out the headings. Latest 1.35 Extension is installed.

Typical page wiki markup for the first few lines has NOTITLE NOTOC Then a = Page Title Text = then "body" text. Just not picking up the body text for some reason unless there isn't a = Page Title Text = at the start of the article. ALSO - why can't this work on category pages?

After trying every fix below that could be applied to the LocalSetting Files, I threw is everything I could find but it's still not working except as above.

$wgExtractsRemoveClasses[] = array( 'dl', 'h1', 'h2', 'h3', 'div', '.mw-editsection', 'table', 'sup.reference', '.error', '.nomobile' ) ;


Here's a link to a page on the wiki in question. It has a mix of links that work and don't work as per my explanation above.

https://dardpi.ca/wiki/index.php?title=The_Last_Train#The_Last_Train

Sorry about posting below in a thread that was already basically finished.

Thiemo Kreuz (WMDE) (talkcontribs)

The problem is that your articles don't have an intro text before the first headline. But this is what the Popups extension expects. You need to disable this. The following combination kind of works for me:

$wgPopupsTextExtractsIntroOnly = false;
$wgExtractsRemoveClasses = [ 'h1', 'h2' ];

Note that most of the "classes" in your list are already in the configuration by default and don't need to be added another time.

STEM (talkcontribs)

Thank you for the reply. Unfortunately it didn't work any better although it seems the ExtractIntroOnly=False makes a lot of sense. Must be those pesky =Title= or ==Title== headlines. Maybe __NOTITLE__ or __NOTOC_ is causing some issues?


Actually I set up a number of test pages and discovered that if the =Headline=, ==Headline== was first on the page, it would generate the "..." extract.

https://nardpi.ca/wiki/index.php?hidebots=1&limit=50&days=7&enhanced=1&title=Special:RecentChanges&urlversion=2


Why does this extension not work on a Category page?

What I'm having a hard time understanding is the documentation that is aimed at programmers. For us configure-type guys it is not clear whatsoever. I would like to know if these items listed under:

prop=extracts (ex)

Can be used in localsettings and if so how? (example would be nice)

Thiemo Kreuz (WMDE) (talkcontribs)

I can't tell what's wrong, sorry. I tested your examples locally (esp. TextExtractTest and TextExtractTest4), and they work for me when I use the two configuration changes mentioned above.

Popups uses the TextExtracts API internally with some of the parameters described at Extension:TextExtracts#API. I guess you don't want to use the TextExtracts API manually, so this will probably not help. The only parameter that can be changed is the "intro" one, see "…IntroOnly" above.

Category pages usually don't contain anything that could be shown in a popup and are excluded by default. See Topic:W9vaqx3tknn5mp6v#flow-post-w9z1ow1y645g2giy.

STEM (talkcontribs)

You have been extremely helpful. Did you test my examples on an IIS 10 or Apache server? I'm IIS,on WIndwos Server 2019. What PHP version and wiki version? I'm PHP 7.4.19 and MW 1.35.2. If you check your Special:Version page, what do you see for a version of TextExtracts? Mine doesn't show a version at all.

https://nardpi.ca/wiki/index.php?title=Special:Version

Is there a critical PHP extension or configuration item I might be missing?

Just so were on the same page, this is my localsetting.php configuration:

//Popups Extension

wfLoadExtensions( [

    'TextExtracts',

    'PageImages',

    'Popups'

] );

$wgPopupsHideOptInOnPreferencesPage = true;

$wgPopupsReferencePreviewsBetaFeature = false;

//PageImages Extension - works with Popups

wfLoadExtension( 'PageImages' );

//Text Extracts Extension - works with Popups

wfLoadExtension( 'TextExtracts' );

$wgPopupsTextExtractsIntroOnly = false;

$wgExtractsRemoveClasses = [ 'h1', 'h2', 'h3' ];


Thanks!

Reply to ".. preview"