[Mediawiki-l] How to test/create/keep TWO params with ONE loop ?

Dr JFBurté burtejf at orange.fr
Thu Apr 10 22:09:51 UTC 2008


Hi
Perharps someone gives a minut to get rid of that :

.. my Loop Template fails in testing/creating/keeping TWO params
{{Loop2}}, even without any param, must dysplay <p1> - <p2>
NB : {{Loop2}} is called by other Template and must "give" both.

<!----------- Code de {{Loop2}} ----------->
Début de Loop2<br />
{{#if:{{{1|}}}|<!-- "Then.1" Réussite du test de <1> on passe au <2> -->
   {{#if:{{{2|}}}|<!-- "Then.2" Réussite du test de <2> -->

      On obtient {{{1}}} - {{{2}}}
      <!-- NB : On veut obtenir p1 - p2 -->

  |<!-- Echec du test de <2> "Else.2" on crée <p2>et on réinjecte -->
  correction de <2> <br />{{Loop2|{{{1}}}|p2}}
  }}
|<!-- Echec du test de <1> "Else.1" on crée <p1> et on réinjecte-->
correction de <1> <br />{{Loop2|p1|{{{2}}}}}
}}

<!------------ On obtient ---------------->
Début de Loop2
correction de <1>
Début de Loop2
On obtient p1 - {{{2}}}

Can see that gives well the first <1> but the second stays {{{2}}
= I understand that {{{2}}} becomes the only unanammed param in the second 
pass (when {{{1}}} : <p1>) but I don't know how to solve that comportement 
and get the both parameters

... where have I to search :  {{subst:}}? <noinclude>?
#http://meta.wikimedia.org/wiki/Help:Advanced_templates
#http://meta.wikimedia.org/wiki/Help:Substitution#Parameter_default_considerations
#http://meta.wikimedia.org/wiki/Help:Template#Repetition_within_a_page
#http://meta.wikimedia.org/wiki/Help:Template





More information about the MediaWiki-l mailing list