[Mediawiki-l] template variables in tag attributes

Ittay Dror ittayd at qlusters.com
Tue Feb 6 07:06:18 UTC 2007



Ittay Dror wrote:
> 
> Fernando Correia wrote:
>> 2007/2/5, Ittay Dror <ittayd at qlusters.com>:
>>> Hi,
>>>
>>> How can I create a template like:
>>> <some-tag attr="{{{1}}}">
>>>   ...
>>> </some-tag>
>> User a parser function.
>>
>> See http://www.gossamer-threads.com/lists/wiki/mediawiki/77335
> 
> thanks! can you by any chance submit your parser function and en example usage? (is it something like {{#tag: some-tag | attr="{{{1}}}" | ...}}?)

ok, worked it out myself. this is the parser function: (tag is the first argument, body is last)

function qwfProcessExtTag(&$parser) {
        $args = func_get_args();
        array_shift( $args );

        $tag =  trim(array_shift($args));
        $body = array_pop($args);
        return "<" . $tag . ' ' . implode(' ', $args) . '>' . $body . '</' . $tag . '>';
}



> 
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l at lists.wikimedia.org
>> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
> 
> 


-- 
===================================
Ittay Dror, 
Chief architect, 
R&D, Qlusters Inc.
ittayd at qlusters.com
+972-3-6081994 Fax: +972-3-6081841

www.openqrm.org - Data Center Provisioning



More information about the MediaWiki-l mailing list