Hi all,
I got a bit perplexed about the order in which templates are expanded.
I tested a template - inside a ParserFunction - inside a parameter
(representing the |default}} value ), but, to my big surprise, the
template obviously expanded inside the parameter! That is, :
1. before ParserFunction (#if: evaluated "yes, a valid string")
2. which was returned as the default value for the parameter.
Simplified: In the simple parameter "{{{param|default}}}" I replaced
"default" by the slightly more complex expression :
{{{param|{{#if:{{GetSomeTitle}}|{{GetSomeTitle}}}}}}} which returned
= SomeTitle
or, more readable:
{{{param|
{{ #if: {{GetSomeTitle}} | {{GetSomeTitle}} }}
}}}
= SomeTitle
(the template GetSomeTitle returns the string "SomeTitle").
What surprised me was that the template (seemingly) were expanded
BEFORE the parameter, which I expected to be resolved before calling
any subsequent templates. Thus it seemd like a hen-or-egg-first
phenomenon... :)
Obviously I must have missed something.
Is there any documentation page which correctly describes the order in
which evaluation is performed of the following (on expand / parse) :
a. Strip for "no parse".
b. Magicwords
c. Parameters
d. Templates
e. Variables (StringFunctions)
f. ParserFunctions (#if:, #ifeq: etc.)
g. Unstrip
And also whether any of the above (forgot some?) are repeated before
and/or after any of the other in the list.
All shared insights on this topic would be much appreciated, TIA.
Regards,
// Rolf Lampa