[Mediawiki-l] Try to build a complicated template that n00b users could use on may Wiki

Dr JFBurté burtejf at orange.fr
Mon Apr 7 08:57:34 UTC 2008


Hi
I need an example of Template with {{{3|{{{2|1}}}}}} (with ParserF #switch 
or in #if/#ifeq/etc ) that runs whith all or none parameters (cf infra)

Why ?
Because I'm looking for the syntax to test some variables to run in only one 
unified Template {{Plan}} that should render differently in different 
NameSpaces and with different variables ( before I used several template, 
but I want to use only one ;O))

This Template aims to dysplay a latéral Help Menu (like InfoBox) in a lot of 
pages, only by including a subpage/TdM with various choices

This three different variables are :
{{{1}}} : the name of the Page to look for Page/TdM for inclusion
{{{f}}} : the format of the dysplay (with or without footer choices)
{{{p}}} : a choice between several namespace of my Wiki (Aide, Projet, 
Modèle, etc)

{{Plan}}, alone(by default ), will search/dysplay Aide:PAGENAME/TdM
=> {{Plan}} in page [[Aide:Accueil]] will include [[Aide:Accueil/TdM]]
.. that's very simple but I need more capacities
... so I'm looking for :
{{Plan|OtherPAGENAME}} will dysplay Aide:OtherPAGENAME/TdM
{{Plan|OtherPAGENAME|f=court}} (choice court|:long by default) will dysplay 
un shortiest one
{{Plan|ThisOtherPAGENAME|p=projet}} (choice within page|projet|portail|:aide 
by default) will search the /TdM in other page Projet:ThisOtherPAGENAME/TdM

ToDay : This works well when I respect writing all the parameters
My problem : How to use {{{3|{{{2|1}}}}}} in #switch or in #if/#ifeq/etc 
make possible all the possibilities with 0, 1 or 2 parameters by future 
users ?

Could you point me such a kind of Template, so I could learn ? 





More information about the MediaWiki-l mailing list