开发者

Expand Magic Words from MediaWiki extension

开发者 https://www.devze.com 2023-02-01 05:27 出处:网络
I need to expand the magicword {{CURRENTPAGEE}} from a mediawiki extension: <extension>{{CURRENTPAGEE}}</extension>

I need to expand the magicword {{CURRENTPAGEE}} from a mediawiki extension:

<extension>{{CURRENTPAGEE}}</extension>

but the macro is not expanded before passing it to the extension's argument, is there any way to get the current page url before passing it to the extension? Or to开发者_StackOverflow社区 get the calling url from inside the extension code? Thanx a lot!


You can either use Parser’s method recursiveTagParse, as described by "How do I render wikitext in my extension?" in the MediaWiki manual, or to get the current page’s title you can indeed use the global $wgTitle or, which is better, the parent frame (passed as fourth parameter to the callback), which has public attribute $title.

0

精彩评论

暂无评论...
验证码 换一张
取 消