Expand Magic Words from MediaWiki 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
.
精彩评论