<mt:Else>

A container tag used within If and Unless blocks to output the alternate case.

This tag supports all of the attributes and logical operators available in the If tag and can be used multiple times to test for different scenarios.

Example:

    <mt:If name="some_variable">
        'some_variable' is assigned
    <mt:Else name="some_other_variable">
        'some_other_variable' is assigned
    <mt:Else>
        'some_variable' nor 'some_other_variable' is assigned
    </mt:If>
This page was last updated on 2007-08-17, 18:25.

2 Notes

And note:

This is the incorrect way to do if/then based on the variable's value:

&lt;mt:if name="align" value="left"&gt;
...do some stuff...
&lt;mt:else name="align" value="right"&gt;
...do some stuff...
&lt;mt:else&gt;
...do some stuff...
&lt;/mt:if&gt;

While this is correct:

&lt;mt:if name="align" eq="left"&gt;
...do some stuff...
&lt;mt:else name="align" eq="right"&gt;
...do some stuff...
&lt;mt:else&gt;
...do some stuff...
&lt;/mt:if&gt;

grumble, sorry, came here from the forums. grumble markdown grumble preview grumble.

This is the incorrect way to do if/then based on the variable's value:

...do some stuff...

...do some stuff...

...do some stuff...

While this is correct:

...do some stuff...

...do some stuff...

...do some stuff...

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.