Hey MediaWiki devs!

TL;DR: When including a SpecialPage (e.g. Special:PrefixIndex), how can
the code access the Title of the page currently being rendered?

I'm sure I'm missing sometthing as I track down this issue, so maybe
this plea for help will result in my enlightenment.

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.  Once I had that, I thought, it would be simple to address
the issue since that page could be compared to the links that are
included from PrefixIndex, but it looks like the context contains the
SpecialPage that is being included and not the page that its output is
being included into.

In my attempt to resolve the problem I was trying to solve, I refactored
Special:PrefixIndex into something I could more easily digest[2].

After that, I'm left with renderRow()[3] where I used my l33t
print-debug skills to fail to find any instance of the calling page--the
page whose wikitext had the {{Special:PrefixIndex}} that was currently
being expanded.

Maybe this is all documented somewhere or maybe it is common knowledge.

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

I know I'm ignorant.  Can someone please enlighten me?

Thanks!

Mark

Footnotes:
[1]  https://phabricator.wikimedia.org/T373259

[2]  https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1069649 --
     reviews welcome!

[3]  
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/6d33307d7908537bc5ae3124c6520571df051239/includes/specials/SpecialPrefixIndex.php#232


-- 
http://hexmode.com/

Don't ask me who's influenced me. A lion is made up of the
lambs he's digested, and I've been reading all my life.
    -- Giorgos Seferis
_______________________________________________
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