PSA on $PARAM declarations



This might be common knowledge, but something that was causing me to go slightly crazy at times over the past few years and I never knew what was going on…

I have a default param value in an include and then pass that include with params into another include etc, like so:

xml:

<include name="Example_Include_Template">
    <param name="left" default="30" />
    <definition>
        <control type="group">
            <left>$PARAM[left]</left>
            ...
        </control>
    </definition>
</include>

<include name="Example_Include_Layout">
    <include content="Example_Include_Template">
        <param name="left" value="$PARAM[left]" />
        ....
    </include>
</include>

<include name="Example_Include_List">
    <param name="left" />
    <definition>
        <include content="Example_Include_Layout">
            <param name="left" value="$PARAM[left]" />
            ...
        </include>
    </definition>
</include>

 
If I define the parameter left in “Example_Include_List”, it should apply that new value to the left value of the group control in “Example_Include_Template”. If I don’t define the parameter left, it should keep the default value of “30” defined in “Example_Include_Template”.

Sometimes this wouldn’t work for me and I never knew why until today.

In “Example_Include_List”, at the top where the params are, I have “<param name=”left” />
I thought this was a way for me to easily keep track of all the params I have in an include but doesn’t do anything because it doesn’t have a default tag. But now I realise it’s the same as putting it to 0 or empty value or whatever. So this line is actually overriding the default value of “30” and replacing it with “0”.

Huh, I never knew that!