[Mediawiki-l] tags and template parameters

aretai aretai aretaiuc at gmail.com
Mon Feb 5 11:56:49 UTC 2007


Sorry have misunderstood you.

Aretai



On 2/5/07, Ittay Dror <ittayd at qlusters.com> wrote:
>
>
> aretai aretai wrote:
> > I think that would be rather extension not a template. Usually
> extensions
> > use <extension></extension> tags to perform given activity. Hooks
> specifies
> > details:
> > $wgParser->setHook( "absHTML", "renderHTML" );
> > In this case <absHTML></absHTML>
> >
> http://meta.wikimedia.org/wiki/MediaWiki_extensions_FAQ#How_do_I_write_my_own_extension.3F
> >
> > If you want to have a template that contains a parameter then just
> create a:
> > wiki/template:MyTemplate
> > and create content like this on your page:
> > {{{1}}}
> > Then if you want a wikipage to make use of it just write
> > {{MyTemplate|1="Some text"}}
> > More details here:
> > http://meta.wikimedia.org/wiki/Help:Template#Parameters
>
> i have written several extensions, parser functions and templates already,
> so this was not my question
>
> say i write a tag extension:
> function qwfProcessMyTag($text, $argv, &$parser) {
>
> }
>
> now, if the user uses it in a template as:
> <my-tag>
> {{{1}}}
> </my-tag>
>
> then $text in the function will be {{{1}}}. this will be the case
> regardless if the template is viewed, or a page containing it. the reason is
> the parser doesn't replace variables inside tags.
>
> i tried using the mArgStack variable, but apparently tags are evaluated
> before replaceVariables is called. so when my tag is processed, the
> arguments have not been set yet
>
> ittay
>
> >
> > Regards,
> > Aretai
> >
> >
> > On 2/5/07, Ittay Dror <ittayd at qlusters.com> wrote:
> >> Hi,
> >>
> >> How can I write a template that contains:
> >> <my-tag>
> >> {{{1}}}
> >> </my-tag>
> >>
> >> so {{{1}}} is replaced?
> >>
> >> thanks,
> >> ittay
> >>
> >> --
> >> ===================================
> >> 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
> >>
> >> _______________________________________________
> >> MediaWiki-l mailing list
> >> MediaWiki-l at lists.wikimedia.org
> >> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >>
> > _______________________________________________
> > 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
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


More information about the MediaWiki-l mailing list