mercredi 21 mars 2018

Multiple if conditions in Movable Type

I'm working on a blog project in Movable Type and I'm absolutely stuck trying to get multiple conditions in an if statement to work.

The end goal is something the equivalent of this:

<mt:SetVar name="foo" value="bar">
<mt:SetVar name="foo1" value="bar1">
<mt:If name="foo" eq="bar">
    <mt:If name="foo1" eq="bar1">
        <div>Foobar Hooray</div>
    </mt:If>
</mt:If>

I have tried as many of the usual combinations as I could think of, but is there one that I am missing? Or is this just not possible in MT?

Even the documentation doesn't reference multiple conditions. https://movabletype.org/documentation/appendices/tags/if.html

These are the attempts made (not in order of attempt) and all will show as true, even though the first condition is false:

<mt:If name="foo" eq="barf" && name="foo1" eq="bar1">
<mt:If (name="foo" eq="barf") && (name="foo1" eq="bar1")>
<mt:If name="foo" eq="barf" & name="foo1" eq="bar1">
<mt:If (name="foo" eq="barf") & (name="foo1" eq="bar1")>
<mt:If name="foo" eq="barf" AND name="foo1" eq="bar1">
<mt:If (name="foo" eq="barf") AND (name="foo1" eq="bar1")>
<mt:If name="foo" eq="barf" And name="foo1" eq="bar1">
<mt:If (name="foo" eq="barf") And (name="foo1" eq="bar1")>
<mt:If name="foo" eq="barf" + name="foo1" eq="bar1">
<mt:If (name="foo" eq="barf") + (name="foo1" eq="bar1")>

Aucun commentaire:

Enregistrer un commentaire