[Mediawiki-l] Passing variables to extensions

Tim Starling tstarling at wikimedia.org
Wed May 9 16:20:17 UTC 2007


Brianna Laugher wrote:
> On 10/05/07, Carlos Jorge Andrade <carlos.andrade at gmail.com> wrote:
>> Hi,
>>
>> Is it possible to pass variables (http://meta.wikimedia.org/wiki/
>> Help:Variable) to extensions ?
>>
>> For exemple...
>>
>> <myExtension snippet="Map" domain="domain.com"
>> title="{{SUBPAGENAME}}" />
>>
>> How do I set the page title as a parameter ? Is there any other way
>> of doing this ?
> 
> global $wgTitle?
> see http://www.mediawiki.org/wiki/Manual:Global_variables

Please do not use $wgTitle in parser extensions. Use $parser->getTitle(),
where $parser is the third parameter to tag-style callbacks or the first
parameter to parser function callbacks.

-- Tim Starling




More information about the MediaWiki-l mailing list