[Mediawiki-l] Comments and Parameters on Templates

Platonides Platonides at gmail.com
Wed Dec 2 14:10:41 UTC 2009


Rodney Morris wrote:
> I've two issues I've been bashing my head against for the last few days
> and finally decided to put it out to the list as a whole.  I'm working
> on an increasingly complex template and I'm hoping you guys might be
> able to provide some easy answers.
>  
> 1) Is it possible to put comments into a template?  Something that will
> only show up on the edit screen for the template, not on the 'view' tab
> and not when the template is used?

Normal wiki comments <!-- --> work on templates.


> 2) Is it possible to assign a parameter value to a parameter within the
> template?  Basically, what I'm trying to do is to use an ifeq statement
> to provide output based on one of three possible parameter values.  For
> example:
>  
> Let's assume the only parameter passed from the calling page is a value
> for "pet".  The two values expected are "dog" or "fish".  If the
> parameter value passed is "dog", then I'd want to assign breathes=air,
> legs=4 and teeth=yes.  If the parameter value from 'pet' is "fish", I'd
> want breathes=water, legs=0 and teeth=none.  Later on in the same
> template, I'd want to put the values for breathers, legs and teeth into
> a table.

Not directly. But you can have your template call a more general parent
template to which it provides the number of legs and teeth.




More information about the MediaWiki-l mailing list