Using ExtraFields In Movable Type

I’ve been doing some work with Movable Type using the ExtraFields plugin recently.

One problem I had was offering an alternative if an extra field hadn’t been set. It turns out that it’s possible to nest an <MTElse> in the <MTIfExtraField> tag.

Here’s an example. I have an extrafield called externalurl on an entry, if it exists I want to use that for the link, if not I want to use the entry’s permalink.

<MTIfExtraField field="externalurl">
<$MTExtraFieldValue field="externalurl"$>
<MTElse>
<$MTEntryPermalink$>
</MTElse>
</MTIfExtraField>

This basically gives us the functionality of a <MTElseExtraField> tag.