Hi Mark,

On 9/1/24 00:36, Mark A. Hershberger via Wikitech-l wrote:
TL;DR: When including a SpecialPage (e.g. Special:PrefixIndex), how can
the code access the Title of the page currently being rendered?

I don't think it's possible, SpecialPageFactory::capturePath() goes to great lengths to hide the real title from code, including overwriting $wgTitle and IContextSource::getTitle().[1]

For T373259[1], I thought it would be straight-forward to get the page
that is the the parser is currently including the results of a special
page into. <snip>

Perhaps it is just a limitation of the way the parser and/or
transclusions works.

I think special page transclusion has always been in a weird spot because people expect it to behave like the special page (and share code) but also be embedded in page context.

Personally I think implementing prefix index support in Lua, aka T49137[2], is a better way to go for customizing the output, but that has its own obstacles of course.

[1] https://gerrit.wikimedia.org/g/mediawiki/core/+/4a955432794ab5f6a609e23b18c9836393109039/includes/specialpage/SpecialPageFactory.php#1713
[2] https://phabricator.wikimedia.org/T49137

-- Legoktm
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to