Welcome to MTTags.com. Hopefully, you'll discover that this a really easy place to find information about Movable Type Template Tags. If you think we could be doing something better, please let us know! If this is your first time here, be sure to stop by the information desk, because we've got a growing todo list that might already include what you were about to suggest.

Utility// 19 Tags

MTDate

The current date and time at publishing. Date format tags may be applied with the format attribute along with the language attribute. See Chapter C: Date Formats.

MTElse

A conditional tag that can be used to represent the opposite of any other conditional tag. This tag must be placed within the conditional tag it is associated with.

MTGetVar

Displays the current value of a variable set by MTSetVar.

Attributes:

  • name - The name of the variable.

MTIfNeedEmail

A conditional tag that displays its contents if the email addresses of all registered users are required by the weblog.

MTIfNonEmpty

A conditional tag that displays its contents if the tag specified with the tag attribute returns a value (i.e. is not empty or null)

Note that a value of '0' is not considered a null value for this tag and will cause the its contents to be printed. If you want to test numerical return values, you should instead use MTIfNonZero.

Attributes:

  • tag - The tag name to evaluate (with or without the MT prefix)

Other attributes are possible. See third example below.

Examples:

The following will print the entry title as an h2 header if a title was given:

<MTIfNonEmpty tag="EntryTitle">
    <h2><$MTEntryTitle$></h2>
</MTIfNonEmpty>

As with all conditional tags, you can use the MTElse tag inside of MTIfNonEmpty to print something if the value of the tag is empty. Here's a brief example that you might use in an MTEntries block to nicely handle entries without categories:

Category: 
    <MTIfNonEmpty tag="EntryCategory">
        <$MTEntryCategory$>

    <MTElse>
        None
    </MTElse>
    </MTIfNonEmpty>

Finally, if you are testing the value of a tag that has one or more attributes, those attributes can be used with MTIfNonEmpty as well. So, for example, to test

<$MTEntryTitle remove_html="1"$>

you do the following:

<MTIfNonEmpty tag="EntryTitle" remove_html="1">
    <title><$MTEntryTitle remove_html="1"$></title>
</MTIfNonEmpty>

Related topics:

MTIfRegistrationAllowed

A conditional tag that will display its contents if registration is enabled but optional.

MTIfRegistrationNotRequired

A conditional tag that will display its contents if a user is not required to sign in to the configured TypeKey authentication system. Alternately the MTElse tag can be used in the MTIfRegistrationRequired tagset.

MTIfRegistrationRequired

A conditional tag that will display its contents if users must sign in to the configured TypeKey-enabled authentication system.

MTIfTypeKeyToken

A container tag that displays its contents if the weblog has a TypeKey system token in place.

MTIfUnregistered

A container tag that will display its contents if unregistered comments are accepted.

MTIgnore

Used to wrap around blocks of MT template code to prevent them from being processed.

Example code:

<MTIgnore>
    This is a comment block - it will not be output or processed by Movable Type.
    <MTEntries lastn="10000">....</MTEntries>
</MTIgnore>

MTImageHeight

The height of the image that was uploaded. Images tags can only be used in the "Uploaded Image Popup" system template.

MTImageURL

The absolute URL of the image that was uploaded. Images tags can only be used in the "Uploaded Image Popup" system template.

MTImageWidth

The width of the image that was uploaded. Images tags can only be used in the "Uploaded Image Popup" system template.

MTInclude

Includes a template module or external file at this point. One and only one of the following attributes must be specified:

Attributes:

  • module - The name of a template module in the current weblog.
  • file - The path to an external file on the system. The path can be absolute or relative to the Local Site Path. This file is included at the time your page is built. It should not be confused with dynamic server side includes like that found in PHP.

The contents of the file or module are further evaluated for more Movable Type template tags.

MTRemoteSignInLink

Produces a complete link to sign in to the configured TypeKey-enabled authentication system based on the SignOnURL configuration directive

MTRemoteSignOutLink

Produces a complete link to sign out to the configured TypeKey-enabled authentication system based on the SignOffURL configuration directive.

MTSignOffURL

Returns the value of SignOffURL as specified in the mt-config.cgi.