The Movable Type User Manual

NOTE: This documentation is for Movable Type 3.2. If you are using a newer version, please see the documentation for Movable type 3.3x or Movable Type Enterprise.

« Displaying a Calendar Layout | Up | Applying a Global Filter to Tag Output »

Chapter 3: Templates and Layout

Publishing Content When a Conditional is False

Problem

You want to publish some content when a conditional is false.

Solution

Use the MTElse tag inside of the container tag.

Discussion

As discussed in the introduction to this chapter, conditionals are a special form of container tags that will display their contents only if a certain condition is true. Movable Type includes MTElse, a very useful tag that can be used with conditional tags. Inside of any conditional, this tag will display its contents if the conditional is false. This template markup demonstrates its use.

 <MTEntryIfExtended>
   <p>TRUE</p>
   <MTElse>
     <p>FALSE</p>
   </MTElse>
 </MTEntryIfExtended>

Used in the context of an entry, "TRUE" would be published if the Extended Body field contained any content. "FALSE" would be published if it did not.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.