Movable Type Template Tag Reference Manual

A

ActionStreams

This tag is a part of the Action Streams plugin bundled with Movable Type 4.25 and higher.

This block template tag shows the specified actions collected for the specified authors from their Action Stream profiles.

Example:

<mt:ActionStreams>
<mt:DateHeader>
<div>
<h3><$mt:StreamActionDate format="%b %d, %Y"$></h3>
<ul>
</mt:DateHeader>
<li class="service-<$mt:var name="service_type"$>">
<mt:StreamActionDate format="%H:%M"> - <$MTStreamAction$>
</li>
<mt:DateFooter>
</ul>
</div>
</mt:DateFooter>
</mt:ActionStreams>

Attributes:

author (optional)

Limits displayed actions to only those collected for specific users. Use an author's login account name (username) here.

For example, with this code only actions by the author with the username "Melody" will be shown:

<mt:ActionStreams author="Melody">

To show actions from several users, separate their usernames with commas:

<mt:ActionStreams author="Melody,Serge">

display_name (optional)

Limits actions to those collected for the specified authors. Use an author's profile display name here.

For example, with this code only actions for the author with the display name "Melody Nelson" are shown:

<mt:ActionStreams display_name="Melody">

To show actions for several authors, separate their display names with commas:

<mt:ActionStreams display_name="Melody Nelson, Serge Gainsbourg">

author_id (optional)

Limits actions to those collected for specified authors. Use an author's numeric ID here.

For example, with this code only actions for author #3 are shown:

<mt:ActionStreams author_id="3">

To show actions for several authors, separate their IDs with commas:

<mt:ActionStreams author_id="3,4,7">

Only one of author_id, display_name and author should be used at a time. If none are given, the authors for whom to show actions are inferred from context: if the tag is used in an author context (such as on an author archive page, inside an <mt:Authors> tag, in an entry context, or on an MT Pro profile page), that one author is selected; otherwise, if the tag is used in a blog context (most of the time), all the authors who can post to that blog are selected.

limit (optional)

Limits the actions shown to the given number (at most). If fewer actions are available in the selected set of actions, fewer will be shown.

days (optional)

Limits the actions shown to those that occurred the specified number of days ago, at the oldest. If fewer actions are available in the selected set of actions, fewer will be shown.

<mt:ActionStreams days="10">

Only one of days and limit should be used. If neither is specified, at most 20 actions are shown.

service (optional)

The ID of the service from which to show actions. Service IDs are the keys used in their service definitions; for example, Twitter's ID is twitter, and Delicious' ID is delicious.

For services with multiple streams, limiting only by service without a stream will list all actions from all of those streams. For example, service="flickr" will list both Flickr photos and Flickr favorites.

<mt:ActionStreams service="flickr">
    <!-- Flickr photos, favorites, etc -->
</mt:ActionStreams>

stream (optional)

The ID of the stream from which to show actions. Stream IDs are the keys used in their recipe definitions; for example, the stream of Delicious links has the ID links, and the stream of Flickr photos has the ID photos.

Because similar streams for all services use the same stream IDs, you can use the stream attribute independent of service to slice for similar actions across services. For example, you can specify stream="photos" with no service attribute to get photo events across services, or stream="favorites" for a multi-source list of favorites.

<mt:ActionStreams stream="photos">
    <!-- Photos from all services -->
</mt:ActionStreams>

To list actions from one particular stream only, use both service and stream.

<mt:ActionStreams service="flickr" stream="favorites">
    <!-- Flickr favorites only -->
</mt:ActionStreams>

sort_by (optional)

Determines the field by which to order the selected actions. By default, actions are ordered by the created_on field (that is, the time when the action occurred or was first found). The available fields to sort by are:

You cannot sort by any of your streams' special additional per-stream fields, even when limiting actions to those streams.

direction (optional)

Determines the direction in which to order the selected actions. Possible values are descend (highest to lowest, latest to earliest) and ascend (lowest to highest, earliest to latest). By default, actions are ordered in descending order (descend).

<mt:ActionStreams sort_by="author_id" direction="ascend">
    <!-- Actions ordered by author ID, lowest to highest -->
</mt:ActionStreams>

AdminCGIPath

Returns the value of the AdminCGIPath configuration setting. Otherwise, the value of the CGIPath setting is returned.

If the value of AdminCGIPath or CGIPath is:

http://www.example.com/cgi-bin/mt/

Or:

/cgi-bin/mt/

Default use of:

<$mt:AdminCGIPath$>

Will output:

http://www.example.com/cgi-bin/mt/

In the event that the configured path has no domain (ie, “/cgi-bin/”), the domain of the blog in context will be used.

The path produced by this tag will always have an ending ‘/’, even if one does not exist as configured.

Values

Output will be a full url to the directory where the Movable Type CGI scripts exist.

Example

Publish “edit” links in index templates:

<a href="<$mt:AdminCGIPath$><$mt:AdminScript$>?__mode=view&_type=template&id=<$mt:BuildTemplateID$>&blog_id=<$mt:BlogID$>">Edit</a>

AdminScript

Returns the value of the AdminScript configuration directive.

Default use of:

<$mt:AdminScript$>

Will output:

mt.cgi

Values

The default value (if unspecified by the AdminScript config directive in mt-config.cgi) is mt.cgi

Examples

Publish “edit” links in index templates:

<a href="<$mt:AdminCGIPath$><$mt:AdminScript$>?__mode=view&_type=template&id=<$mt:BuildTemplateID$>&blog_id=<$mt:BlogID$>">Edit</a>

App:ActionBar

Produces markup for application templates for the strip of actions for a application listing or edit screen.

Attributes

App:Form

Used for application templates that need to express a standard MT application form. This produces certain hidden fields that are typically required by MT application forms.

Attributes:

Example:

    <mtapp:Form id="update" mode="update_blog_name">
        Blog Name: <input type="text" name="blog_name" />
        <input type="submit" />
    </mtapp:Form>

Producing:

    <form id="update" name="update" action="/cgi-bin/mt.cgi" method="POST">
    <input type="hidden" name="__mode" value="update_blog_name" />
        Blog Name: <input type="text" name="blog_name" />
        <input type="submit" />
    </form>

App:Link

Produces a application link to the current script with the mode and attributes specified.

Attributes:

Example:

    <$MTApp:Link mode="foo" type="entry" bar="1"$>

produces:

    /cgi-bin/mt/mt.cgi?__mode=foo&_type=entry&bar=1

This tag produces unescaped '&' characters. If you use this tag in an HTML tag attribute, be sure to add a escape="html" attribute which will encode these to HTML entities.

App:ListFilters

An application template tag used to produce an unordered list of quickfilters for a given listing screen. The filters are drawn from a list_filters template variable which is an array of hashes.

Example:

    <$mtapp:ListFilters$>

App:Listing

This application tag is used in MT application templates to produce a table listing. It expects an object_loop variable to be available, or you can use the loop attribute to have it use a different source.

It will output it's contents once for each row of the input array. It produces markup that is compatible with the MT application templates and CSS structure, so it is not meant for general blog publishing use.

The return_args variable is recognized and will populate a hidden field in the produced form tag if available.

The blog_id variable is recognized and will populate a hidden field in the produced form tag if available.

The screen_class variable is recognized and will force the hide_pager attribute to 1 if it is set to 'search-replace'.

The magic_token variable is recognized and will populate a hidden field in the produced form tag if available (or will retrieve a token from the current application if unset).

The view_expanded variable is recognized and will affect the class name applied to the table. If assigned, the table tag will receive a 'expanded' class; otherwise, it is given a 'compact' class.

The listing_header variable is recognized and will be output in a div tag (classed with 'listing-header') that appears at the top of the listing. This is only output when 'actions' are shown (see 'show_actions' attribute).

The structure of the output from a typical use like this:

    <MTApp:Listing type="entry">
        (contents of one row for table)
    </MTApp:Listing>

produces something like this:

    <div id="entry-listing" class="listing">
        <div class="listing-header">
        </div>
        <form id="entry-listing-form" class="listing-form"
            action="..../mt.cgi" method="post"
            onsubmit="return this['__mode'] ? true : false">
            <input type="hidden" name="__mode" value="" />
            <input type="hidden" name="_type" value="entry" />
            <input type="hidden" name="action_name" value="" />
            <input type="hidden" name="itemset_action_input" value="" />
            <input type="hidden" name="return_args" value="..." />
            <input type="hidden" name="blog_id" value="1" />
            <input type="hidden" name="magic_token" value="abcd" />
            <$MTApp:ActionBar bar_position="top"
                form_id="entry-listing-form"$>
            <table id="entry-listing-table"
                class="entry-listing-table compact" cellspacing="0">

                (contents of tag are placed here)

            </table>
            <$MTApp:ActionBar bar_position="bottom"
                form_id="entry-listing-form"$>
        </form>
    </div>

Attributes:

App:PageActions

An application template tag used to produce an unordered list of actions for a given listing screen. The actions are drawn from a page_actions template variable which is an array of hashes.

Example:

    <$mtapp:PageActions$>

App:Setting

An application template tag used to display an application form field.

Attributes:

Example:

    <mtapp:Setting
        id="name"
        required="1"
        label="Username"
        hint="The username used to login">
            <input type="text" name="name" id="name" value="<$mt:Var name="name" escape="html"$>" />
    </mtapp:setting>

The basic structural output of a setting tag looks like this:

    <div id="ID-field" class="field pkg">
        <div class="field-inner">
            <div class="field-header">
                <label id="ID-label" for="ID">LABEL</label>
            </div>
            <div class="field-content">
                (content of App:Setting tag)
            </div>
        </div>
    </div>

App:SettingGroup

An application template tag used to wrap a number of App:Setting tags.

Attributes:

Example:

    <MTApp:SettingGroup id="foo">
        <MTApp:Setting ...>
        <MTApp:Setting ...>
        <MTApp:Setting ...>
    </MTApp:SettingGroup>

App:StatusMsg

An application template tag that outputs a MT status message.

Attributes:

App:Widget

An application template tag that produces HTML for displaying a MT CMS dashboard widget. Custom widget templates should utilize this tag to wrap their widget content.

Attributes:

Example:

    <mtapp:Widget class="widget my-widget"
        label="<__trans phrase="All About Me">" can_close="1">
        (contents of widget go here)
    </mtapp:Widget>

ArchiveCategory

Deprecated: Use mt:CategoryLabel

Returns the label of the current category.

ArchiveCount

This tag will return a value corresponding to the number of entries in an ArchiveList block tag context.

Additionally, this tag can be used in other contexts, and will potentially return two different values depending upon the context in which it is invoked.

If invoked within Categories this tag will behave as if it was an alias to CategoryCount.

Otherwise it will return the number corresponding to the number of entries currently in context. For example within any Entries context, this tag will return the number of entries that that Entries tag corresponds to.

Alternatively, Count tags exist for each object, which are often a better choice when working outside of the ArchiveList block tag context.

Simple Example

<mt:Categories>
    There are <mt:ArchiveCount> entries in the <mt:CategoryLabel> category.
<mt:Categories>

Attributes

All <mt:ArchiveCount> attributes are optional. The most common attributes are:

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:ArchiveCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:ArchiveCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:ArchiveCount none="No entries">

or

<mt:ArchiveCount none="None">

Example with Attributes

<$mt:ArchiveCount singular="1 entry" plural="# entries" none="no entries">

ArchiveDate

The starting date of the archive in context. For use with the Monthly, Weekly, and Daily archive types only. Date format tags may be applied with the format attribute along with the language attribute. See Date for attributes that are supported.

ArchiveDateEnd

The ending date of the archive in context. For use with the Monthly, Weekly, and Daily archive types only. Date format tags may be applied with the format attribute along with the language attribute. See Date tag for supported attributes.

Attributes:

Example:

    <$mt:ArchiveDateEnd$>

ArchiveFile

The archive filename including file extension for the archive in context. This can be controlled through the archive mapping section of the blog's Publishing settings screen.

Example: For the URL http://www.example.com/categories/politics.html, the ArchiveFile tag would output "politics.html".

Attributes:

Example:

    <$mt:ArchiveFile$>

ArchiveLabel

An alias for the ArchiveTypeLabel tag.

Notes:

Deprecated in favor of the more specific tag: ArchiveTypeLabel

ArchiveLink

Publishes a link to the archive template for the current archive context. You may specify an alternate archive type with the “type” attribute to publish a different archive link.

Attributes

Example

When publishing an entry archive template, you can use the following tag to get a link to the appropriate Monthly archive template relevant to that entry (in other words, if the entry was published in March 2008, the archive link tag would output a permalink for the March 2008 archives).

<mt:ArchiveLink type="Monthly">

ArchiveList

A container tag representing a list of all the archive pages of a certain type.

Attributes

You may produce an archive list of any supported archive type even if you are not publishing that archive type. However, the ArchiveLink tag will only work for archive types you are publishing.

Example

<mt:ArchiveList archive_type="Monthly">
    <a href="<mt:ArchiveLink>"><mt:ArchiveTitle></a>
</mt:ArchiveList>

Here, we’re combining two ArchiveList tags (the inner ArchiveList tag is bound to the date range of the year in context):

<mt:ArchiveList type="Yearly" sort_order="ascend">
    <mt:ArchiveListHeader>
    <ul>
    </mt:ArchiveListHeader>
        <li><mt:ArchiveDate format="%Y">
    <mt:ArchiveList type="Monthly" sort_order="ascend">
        <mt:ArchiveListHeader>
            <ul>
        </mt:ArchiveListHeader>
                <li><mt:ArchiveDate format="%b"></li>
        <mt:ArchiveListFooter>
            </ul>
        </mt:ArchiveListFooter>
        </li>
    </mt:ArchiveList>
    <mt:ArchiveListFooter>
    </ul>
    </mt:ArchiveListFooter>
</mt:ArchiveList>

to publish something like the result below (assuming Entries exist for the dates listed).

<ul>
    <li>2006
        <ul>
            <li>Mar</li>
            <li>Apr</li>
            <li>May</li>
        </ul>
    </li>
    <li>2007
        <ul>
            <li>Apr</li>
            <li>Jun</li>
            <li>Dec</li>
        </ul>
    </li>
</ul>

Version History

Movable Type version 4.2 introduced a bug where using this tag in a dynamic publishing environment would require that the selected Archive Type be enabled. This was fixed in 4.21. (Bug #82302)

ArchiveListFooter

The contents of this container tag will be displayed when the last entry listed by a ArchiveList tag is reached.

ArchiveListHeader

The contents of this container tag will be displayed when the first entry listed by a ArchiveList tag is reached.

ArchiveNext

A container tag that creates a context to the “next” archive relative to the current archive context. The counterpart to ArchivePrevious.

Attributes

Example

<mt:ArchiveNext>
    <a href="<$mt:ArchiveLink$>"
        title="<$mt:ArchiveTitle escape="html"$>Next</a>
</mt:ArchiveNext>

Note: mt:ArchiveNext is a container tag, not a conditional tag. As a result, it cannot be used in conjunction with mt:Else.

ArchivePrevious

A container tag that creates a context to the “previous” archive relative to the current archive context. The counterpart to ArchiveNext.

Attributes

Example

<mt:ArchivePrevious>
    <a href="<$mt:ArchiveLink$>"
        title="<$mt:ArchiveTitle escape="html"$>">Previous</a>
 </mt:ArchivePrevious>

Note: mt:ArchivePrevious is a container tag, not a conditional tag. As a result, it cannot be used in conjunction with mt:Else.

Archives

A container tag representing a list of all the enabled archive types in a blog. This tag exists to facilitate the publication of a Google sitemap or something of a similar nature.

Attributes:

Example:

    <mt:Archives>
        <mt:ArchiveList><mt:ArchiveLink>
        </mt:ArchiveList>
    </mt:Archives>

This will publish a link for each archive type you publish (the primary archive links, at least).

ArchiveTitle

A descriptive title of the current archive. The value returned from this tag will vary based on the archive type:

Example:

    <$mt:ArchiveTitle$>

ArchiveType

Publishes the identifier for the current archive type. Typically, one of “Daily”, “Weekly”, “Monthly”, “Yearly”, “Category”, “Individual”, “Page”, etc. (A complete list of possible values values for type can be found on the EntryLink tag.)

Example

If used in an Individual Entry template:

<mt:ArchiveType>

Will output:

Individual

ArchiveTypeLabel

A descriptive label of the current archive type.

The value returned from this tag will vary based on the archive type: Daily, Weekly, Monthly, Yearly, Author, Author Daily, Author Weekly, Author Monthly, Author Yearly, Category, Category Daily, Category Weekly, Category Monthly, Category Yearly

Example

<mt:ArchiveTypeLabel>

Related Tags: ArchiveType

Asset

Container tag that provides an asset context for a specific asset, from which all asset variable tags can be used to retreive metadata about that asset.

Attributes:

Example:

    <mt:Asset id="10">
        <$mt:AssetLabel$>
    </mt:Asset>

AssetAddedBy

Display name (or username if display name isn't assigned) of the user who added the asset to the system.

Example:

    <$mt:AssetAddedBy$>

AssetCount

Returns the number of assets associated with the active blog.

It may be important for your use to note that both parent and child assets (such as thumbnail images) are included in this count.

Attributes

Example

Images available: <mt:AssetCount type="image" singular="1 image" plural="# images" none="no images">

AssetDateAdded

The date the asset in context was added to Movable Type.

Attributes:

Example:

    <$mt:AssetDateAdded$>

AssetDescription

This tag returns the description text of the asset currently in context.

Example:

    <$mt:AssetDescription$>

AssetFileExt

The file extension of the asset in context. For file-based assets only. Returns the file extension without the leading period (ie: "jpg").

Example:

    <$mt:AssetFileExt$>

AssetFileName

The file name of the asset in context. For file-based assets only. Returns the file name without the path (i.e. file.jpg, not /home/user/public_html/images/file.jpg).

Example:

    <$mt:AssetFileName$>

AssetFilePath

Path information of the asset in context. For file-based assets only. Returns the local file path with the name of the file (i.e. /home/user/public_html/images/file.jpg).

Example:

    <$mt:AssetFilePath$>

AssetID

A numeric system ID of the Asset currently in context.

Example:

    <$mt:AssetID$>

AssetIfTagged

This template tag evaluates a block of code if a tag has been assigned to the current asset in context.

If the tag attribute is not assigned, then the template tag will evaluate if any tag is present.

Check for a specific tag…

<mt:AssetIfTagged tag="Foo">
    This asset has the tag "Foo"
</mt:AssetIfTagged>

Check if any tags are assigned to the asset…

<mt:AssetIfTagged>
    This asset has tags
</mt:AssetIfTagged>

Context

Attributes

tag=”foo”

If present, the template tag will evaluate if the specified tag is assigned to the current asset.

include_private=”0”

Include private tag if “1” is set.

Example

Conditional if tagged “Foo” or not:

<mt:AssetIfTagged tag="Foo">
    <!-- do something -->
<mt:Else>
    <!-- do something else -->
</mt:AssetIfTagged>

Condition based upon if a asset is tagged with the private tag @draft:

<mt:Assets>
    <li class="asset <mt:AssetIfTagged tag="@draft">draft</mt:AssetIfTagged>">
        <a href="<$mt:AssetURL$>"><$mt:AssetLabel$></a>
        <mt:AssetIfTagged tag="@draft">(draft)</mt:AssetIfTagged>
    </li>
</mt:Assets>

Related

AssetIsFirstInRow

A conditional tag that displays its contents if the asset in context is the first item in the row in context when publishing a grid of assets (e.g. thumbnails). Grid of assets can be created by specifying assets_per_row attribute value to Assets block tag.

For example, the first, the fourth and the seventh asset are the first assets in row when Assets iterates eight assets and assets_per_row is set to "3".

Example:

    <table>
      <mt:Assets type="image" assets_per_row="4">
        <mt:AssetIsFirstInRow><tr></mt:AssetIsFirstInRow>
          <td><$mt:AssetThumbnailLink$></td>
        <mt:AssetIsLastInRow></tr></mt:AssetIsLastInRow>
      </mt:Assets>
    </table>

AssetIsLastInRow

A conditional tag that displays its contents if the asset in context is the last item in the row in context when publishing a grid of assets (e.g. thumbnails). Grid of assets can be created by specifying assets_per_row attribute value to Assets block tag.

For example, the third, the sixth and the eighth asset are the last assets in row when Assets iterates eight assets and assets_per_row is set to "3".

Example:

    <table>
      <mt:Assets type="image" assets_per_row="4">
        <mt:AssetIsFirstInRow><tr></mt:AssetIsFirstInRow>
          <td><$mt:AssetThumbnailLink$></td>
        <mt:AssetIsLastInRow></tr></mt:AssetIsLastInRow>
      </mt:Assets>
    </table>

AssetLabel

Returns the label of the asset in context. Label can be specified upon uploading a file.

Example:

    <$mt:AssetLabel$>

AssetLink

Returns HTML anchor tag for the asset in context. For example, if the URL of the asset is http://example.com/image.jpg, the tag returns <a href="http://example.com/image.jpg">image.jpg</a>.

Attributes:

Example:

    <$mt:AssetLink$>

AssetMimeType

Returns MIME type of the asset in context. MIME type of a file is typically provided by web browser upon uploading.

Example:

    <$mt:AssetMimeType$>

AssetProperty

Returns the additional metadata of the asset in context. Some of these properties only make sense for certain file types. For example, image_width and image_height apply only to images.

Attributes:

AssetRank

A function tag which returns a number from 1 to 6 (by default) which represents the rating of the asset in context in terms of total score where '1' is used for the highest score, '6' for the lowest score.

Attributes:

Example:

    <$mt:AssetRank namespace="FiveStarRating"$>

Assets

A container tag which iterates (loops) over a list of Assets from one or more blogs.

<mt:Assets>
    <mt:AssetLabel>: <mt:AssetDescription>
</mt:Assets>

This container tag may contain any Asset function template tags.

Similarly, the EntryAssets and PageAssets tags will list all assets with the respective entry or page.

Modifiers


assets_per_row

This attribute sets how many iterations the Assets tag publishes before setting the state that enables the AssetIsLastInRow AssetIsFirstInRow tags.

</mt:AssetIsLastInRow>

Supported values:

author

Selects assets uploaded by a single author.

Specify author’s username.

<mt:Assets author="beau">
    <!-- tags here -->
</mt:Assets>

days

Selects assets created in the last number of days specified.

<mt:Assets days="3">
    <!-- tags here -->
</mt:Assets>

file_ext

Selects assets by file extension.

Supports a comma-delimited list of file extensions.

<mt:Assets file_ext="gif, mp3, pdf">
    <!-- tags here -->
</mt:Assets>

type

Selects assets by asset type.

<mt:Assets file_ext="image">
    <!-- tags here -->
</mt:Assets>

Supports a comma-delimited list of asset types:

lastn

Limits the selection of assets to the specified number.

<mt:Assets lastn="3">
    <!-- tags here -->
</mt:Assets>

limit

A positive integer to limit results.

<mt:Assets limit="3">
    <!-- tags here -->
</mt:Assets>

namespace

Used in conjunction with the sort_by attribute when sorting by “score”. The namespace identifies the method of scoring to use in sorting assets.

offset

Used in coordination with lastn, starts N assets from the start of the list. N is a positive integer.

<mt:Assets lastn="1">
    <!-- special treatment for first asset -->
</mt:Assets>
<mt:Assets lastn="9" offset="1">
    <!-- alternate treatment for next 9 assets -->
</mt:Assets>

sort_by

Sort assets by value.

<mt:Assets sort_by="label">
    <!-- asset tags -->
</mt:Assets>

Supported values:

sort_order

Supported values:

tag

Selects assets with particular tags.

Supports expressions such as “interesting AND featured”).

<mt:Assets tag="foo AND bar">
    <!-- tags here -->
</mt:Assets>

ignore_archive_context

If the ignore_archive_context modifier is set to 1, assets are loaded without regard for the current archive in context. This modifier was added to Movable Type 6.0.4.

Examples

This container tag loop lists all assets in the current blog that have the favorite tag.

<mt:Assets lastn="10" type="image" tag="favorite">
   <a href="<mt:AssetURL>">
      <img src="<mt:AssetThumbnailURL height="70">"
           alt="<mt:AssetLabel escape="html">"
           title="<mt:AssetLabel escape="html">" />
   </a>
</mt:Assets>

This container tag loop lists all assets associated with a Movable Type 5.x or 6.x website or any one of the blogs that is owned by that website.

<mt:Assets include_blogs="children" include_with_website="1">
 <mt:AssetLabel>: <mt:AssetFilePath><br />
</mt:Assets>

Related

AssetScore

A function tag that provides total score of the asset in context. Scores grouped by namespace of a plugin are summed to calculate total score of an asset.

Attributes:

Example:

    <$mt:AssetScore namespace="FiveStarRating"$>

AssetScoreAvg

A function tag that provides the avarage score of the asset in context. Scores grouped by namespace of a plugin are summed to calculate total score of an asset, and average is calculated by dividing the total score by the number of scorings or 'votes'.

Attributes:

Example:

    <$mt:AssetScoreAvg namespace="FiveStarRating"$>

AssetScoreCount

A function tag that provides the number of scorings or 'votes' made to the asset in context. Scorings grouped by namespace of a plugin are summed.

Attributes:

Example:

    <$mt:AssetScoreCount namespace="FiveStarRating"$>

AssetScoreHigh

A function tag that provides the highest score of the asset in context. Scorings grouped by namespace of a plugin are sorted to find the highest score of an asset.

Attributes:

Example:

    <$mt:AssetScoreHigh namespace="FiveStarRating"$>

AssetScoreLow

A function tag that provides the lowest score of the asset in context. Scorings grouped by namespace of a plugin are sorted to find the lowest score of an asset.

Attributes:

Example:

    <$mt:AssetScoreLow namespace="FiveStarRating"$>

AssetsFooter

The contents of this container tag will be displayed when the last entry listed by a Assets tag is reached.

AssetsHeader

The contents of this container tag will be displayed when the first entry listed by a Assets tag is reached.

AssetTags

A container tag used to output infomation about the asset tags assigned to the asset in context.

To avoid printing out the leading text when no asset tags are assigned you can use the AssetIfTagged conditional block to first test for asset tags on the asset. You can also use the AssetIfTagged conditional block with the tag attribute to test for the assignment of a particular entry tag.

Attributes:

Example:

The following code can be used anywhere Assets can be used. It prints a list of all of the tags assigned to each asset returned by Assets glued together by a comma and a space.

    <mt:If tag="AssetTags">
        The asset "<$mt:AssetLabel$>" is tagged:
        <mt:AssetTags glue=", "><$mt:TagName$></mt:AssetTags>
    </mt:If>

AssetThumbnailLink

When a type of item is image, XHTML tag to show a thumbnail with link to its original file, will be shown. You can set size of thumbnail by using modifiers that allows you to set sizes of image. If you don't set size of thumbnail image, thumbnail shown will be the same as its original size.

Attributes:

AssetThumbnailURL

Returns the URL for a thumbnail you wish to generate for the current asset in context.

Attributes:

Example:

The following will output thumbnails for all of the assets embedded in all of the entries on the system. Each thumbnail will be square and have a max height/width of 100 pixels.

    <mt:Entries>
        <mt:EntryAssets>
            <$mt:AssetThumbnailURL width="100" square="1"$>
        </mt:EntryAssets>
    </mt:Entries>

AssetType

Returns the localized name for the type of asset currently in context. For instance, for an image asset, this will tag will output (for English blogs), "image".

Example:

    <$mt:AssetType$>

AssetURL

Produces a permalink for the uploaded asset.

Example:

    <$mt:AssetURL$>

AtomScript

Returns the value of the AtomScript configuration setting. The default for this setting if unassigned is "mt-atom.cgi".

AudioCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

AudioCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

AudioCustomFields

This container tag iterates, or loops, over all custom fields associated with an audio type asset.

See mt:EntryCustomFields for more details.

<mt:AudioCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:AudioCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:AudioCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:AudioCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:AudioCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:AudioCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

AudioCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

AuthorAuthIconURL

Returns URL to a small (16x16) image represents in what authentication provider the author in context is authenticated. For most of users it will be a small spanner logo of Movable Type. If user is a commenter, icon image is provided by each of authentication provider. Movable Type provides images for Vox, LiveJournal and OpenID out of the box.

Attributes:

Example:

    <mt:Authors>
        <img src="<$mt:AuthorAuthIconURL$>" height="16" width="16" />
        <$mt:AuthorDisplayName$>
    </mt:Authors>

AuthorAuthType

Outputs the authentication type identifier for the author currently in context. For Movable Type registered users, this is "MT".

AuthorBasename

Outputs the “Basename” field of the author currently in context.

Attributes

AuthorCommentCount

Returns the number of published comments left by the Author in context.

Attributes

Example

<mt:Authors>
    <h3><mt:AuthorDisplayName></h3>
    <ul>
        <li><mt:AuthorCommentCount> comments</li>
        <li><mt:AuthorEntriesCount> entries created</li>
        <li><mt:AuthorEntryCount> entries published</li>
    </ul>
 </mt:Authors>

AuthorComments

This template tag is used to retrieve a list of all the comments left by the current author in context. It is used for example on a user's profile page to list the comments they have left within the system.

Attributes

This template tag uses all the same attributes as the MTComments template tag.

AuthorCustomFieldDescription

Deprecated: Same as mt:CustomFieldDescription. See EntryCustomFields for more info.

This will display the description of the current custom field in context.

AuthorCustomFieldName

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

AuthorCustomFields

This container tag iterates, or loops, over all custom fields associated with a author.

See mt:EntryCustomFields for more details.

<mt:Authors>
    <mt:AuthorCustomFields>
        <$mt:CustomFieldName$>
    </mt:AuthorCustomFields>
</mt:Authors>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:AuthorCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:AuthorCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:AuthorCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:AuthorCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

AuthorCustomFieldValue

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

AuthorDisplayName

Outputs the display name of the author currently in context. If no author is in context, it will use the author of the entry or page in context.

AuthorEmail

Outputs the email address of the author currently in context. If no author is in context, it will use the author of the entry or page in context.

NOTE: it is not recommended to publish the author's email address.

AuthorEntriesCount

The number of entries created by the current author in context.

Example

 <mt:Authors>
 <$mt:AuthorDisplayName$>
 <ul>
   <li><$mt:AuthorCommentCount$> comments</li>
   <li><$mt:AuthorEntriesCount$> posts</li>
   <li><$mt:AuthorEntryCount$> published</li>
 </ul>
 </mt:Authors>

AuthorEntryCount

The number of published entries created by the current author in context.

Example

 <mt:Authors>
 <$mt:AuthorDisplayName$>
 <ul>
   <li><$mt:AuthorCommentCount$> comments</li>
   <li><$mt:AuthorEntriesCount$> posts</li>
   <li><$mt:AuthorEntryCount$> published</li>
 </ul>
 </mt:Authors>

AuthorFavoriteEntries

This template tag returns a list of entries flagged as a favorite by the current author in context. Typically used on the user profile template.

See <mt:Entries> for more info.

AuthorHasEntry

A conditional tag that is true when the author currently in context has written one or more entries that have been published.

    <mt:AuthorHasEntry>
    <a href="<$mt:ArchiveLink type="Author">">Archive for this author</a>
    </mt:AuthorHasEntry>

AuthorHasPage

A conditional tag that is true when the author currently in context has written one or more pages that have been published.

AuthorID

Outputs the numeric ID of the author currently in context. If no author is in context, it will use the author of the entry or page in context.

AuthorName

Outputs the username of the author currently in context. If no author is in context, it will use the author of the entry or page in context.

NOTE: it is not recommended to publish the author's username.

AuthorNext

A container tag which creates a author context of the next author. The order of authors is determined by author's login name. Authors who have at least a published entry will be considered in finding the next author.

Example:

    <mt:AuthorNext>
        <a href="<$mt:ArchiveLink archive_type="Author"$>"><$mt:AuthorDisplayName$></a>
    </mt:AuthorNext>

AuthorPrevious

A container tag which creates a author context of the previous author. The order of authors is determined by author's login name. Authors who have at least a published entry will be considered in finding the previous author.

Example:

    <mt:AuthorPrevious>
        <a href="<$mt:ArchiveLink archive_type="Author"$>"><$mt:AuthorDisplayName$></a>
    </mt:AuthorPrevious>

AuthorRank

A function tag which returns a number from 1 to 6 (by default) which represents the rating of the author in context in terms of total score where '1' is used for the highest score, '6' for the lowest score.

Attributes:

Example:

    <$mt:AuthorRank namespace="FiveStarRating"$>

Authors

A container tag which iterates over a list of authors (users with a permission).

Default listing includes Authors who have at least one published entry.

<mt:Authors>
    <$mt:AuthorDisplayName$>
</mt:Authors>

Attributes

All fields are optional.

any_type

Pass a value of “1” for this attribute to select users of any type associated with the blog, including commenters. Default is “0”. Requires the use of need_entry="0"

Display all authors of any type in the installation:

<mt:Authors any_type="1" need_entry="0">
    <li><$mt:AuthorDisplayName$> [<$mt:AuthorID$>]</li>
</mt:Authors>

Bug: any_type attribute of mt:Authors doesn’t work as expected

display_name

Specifies the display name a particular author to select.

<mt:Authors display_name="Melody Nelson">
    <!-- do something -->
</mt:Authors>

id

Specifies a particular author to select by unique id number. This attribute takes precedence over all others.

<mt:Authors id="12">
    <!-- do something -->
</mt:Authors>

lastn

Limits the selection of authors to the specified number. Has nothing to do with recent (as in recent dates) as lastn does for most other loop tags.

Limit the result to 4 newly creatd authors (using sort_by and sort_order attributes).

<mt:Authors lastn="4" sort_by="created_on" sort_order="descend">
    <!-- do something -->
</mt:Authors>

limit

Alias to lastn.

min_score

If ‘namespace’ is also specified, filters the authors based on the score within that namespace. This specifies the minimum score to consider the author for inclusion.

max_score

If ‘namespace’ is also specified, filters the authors based on the score within that namespace. This specifies the maximum score to consider the author for inclusion.

min_rate

If ‘namespace’ is also specified, filters the authors based on the rank within that namespace. This specifies the minimum rank to consider the author for inclusion.

max_rate

If ‘namespace’ is also specified, filters the authors based on the rank within that namespace. This specifies the maximum rank to consider the author for inclusion.

min_count

If ‘namespace’ is also specified, filters the authors based on the count within that namespace. This specifies the minimum count to consider the author for inclusion.

max_count

If ‘namespace’ is also specified, filters the authors based on the count within that namespace. This specifies the maximum count to consider the author for inclusion.

namespace

Used in conjunction with the “min_*” and “max_*” attributes to select authors based on a particular scoring mechanism.

need_entry

Boolean identifier to determine whether the author(s) must have published an entry to be included or not. Default “1”, author needs to have published an entry.

Select all authors with “Author” role regardless of whether they have any entries associated to them.

<mt:Authors role="Author" need_entry="0">
    <$mt:AuthorDisplayName$>
</mt:Authors>

need_association

Boolean identifier to require author(s) to have explicit association to the blog(s) in context. This attribute can be used to exclude system administrators who do not have explicit association to the blog(s). This attribute requires blog context which can be created by include_blogs, exclude_blogs and blog_ids. Default is “0”

role

A the role(s) used to filter returned authors.

Value can be a comma separated list of roles (which will be converted to a list of roles separated with ” OR “):

<mt:Authors role="Author, Contributor">

Or roles can be specified directly with the “OR” operator:

<mt:Authors role="Author OR Contributor">

Select all users with the role “Editor”:

<mt:Authors role="Editor">

Select all users with the role NOT “Editor”:

<mt:Authors role="!(Editor)">

Bug: Role attribute of mt:Authors using NOT syntax lists authors not associated to the current blog

roles

Alias of role.

scoring_to

If ‘namespace’ is also specified, filters the authors based on the score within that namespace. This attribute specifies which type of object to look up. the object has to be specified in context.

sort_by

Sort by author data. See lastn for example.

Supported values:

sort_order

Order of returned authors. See lastn for example.

Supported values:

status

Supported values:

username

Specifies the username a particular author to select. Like the id attribute, this attribute takes precedence over all others.

<mt:Authors display_name="Melody Nelson">
    <!-- do something -->
</mt:Authors>

The username and id should never be used together because they are both idetifiers for a particular user.

Examples

List all Authors in a blog with at least 1 entry:

<mt:Authors>
   <a href="<$mt:AuthorURL$>"><$mt:AuthorDisplayName$></a>
</mt:Authors>

List all Authors and Commenters for a blog:

<mt:Authors need_entry="0" roles="Author, Commenter">
    <a href="<$mt:AuthorURL$>"><mt:AuthorDisplayName$></a>
</mt:Authors>

Recent Entries per Author:

<mt:Authors>
    <h1><$mt:AuthorName$></h1>
    <mt:SetVarBlock name="author"><$mt:AuthorName$></mt:SetVarBlock>
    <ul>
        <mt:Entries author="$author" lastn="10">
        <li><a href="mt:Permalink"><$mt:EntryTitle$></a></li>
        </mt:Entries>
    </ul>
</mt:Authors>

Link to the author archive for each author using the ArchiveLink tag:

<mt:Authors>
    <a href="<$mt:ArchiveLink type="Author"$>"><$mt:AuthorDisplayName$></a>
</mt:Authors>

Links to all commenter’s profiles:

<mt:Authors role="Commenter">
    <a href="<mt:CGIPath><mt:CommunityScript>?__mode=view&amp;blog_id=<mt:BlogID>&amp;id=<mt:AuthorID>"><mt:AuthorDisplayName></a>
</mt:Authors>

Related

AuthorScore

A function tag that provides total score of the author in context. Scores grouped by namespace of a plugin are summed to calculate total score of an author.

Attributes:

Example:

    <$mt:AuthorScore namespace="FiveStarRating"$>

AuthorScoreAvg

A function tag that provides the avarage score of the author in context. Scores grouped by namespace of a plugin are summed to calculate total score of an author, and average is calculated by dividing the total score by the number of scorings or 'votes'.

Attributes:

Example:

    <$mt:AuthorScoreAvg namespace="FiveStarRating"$>

AuthorScoreCount

A function tag that provides the number of scorings or 'votes' made to the author in context. Scorings grouped by namespace of a plugin are summed.

Attributes:

Example:

    <$mt:AuthorScoreCount namespace="FiveStarRating"$>

AuthorScoreHigh

A function tag that provides the highest score of the author in context. Scorings grouped by namespace of a plugin are sorted to find the highest score of an author.

Attributes:

Example:

    <$mt:AuthorScoreHigh namespace="FiveStarRating"$>

AuthorScoreLow

A function tag that provides the lowest score of the author in context. Scorings grouped by namespace of a plugin are sorted to find the lowest score of an author.

Attributes:

Example:

    <$mt:AuthorScoreLow namespace="FiveStarRating"$>

AuthorURL

Outputs the URL field of the author currently in context. If no author is in context, it will use the author of the entry or page in context.

AuthorUserpic

This template tags returns a complete HTML <img> tag representing the current author's userpic. For example:

    <img src="http://www.yourblog.com/path/to/userpic.jpg"
        width="100" height="100" />

AuthorUserpicAsset

This container tag creates a context that contains the userpic asset for the current author. This then allows you to use all of Movable Type's asset template tags to display the userpic's properties.

    <ul><mt:Authors>
         <mt:AuthorUserpicAsset>
           <li>
             <img src="<$mt:AssetThumbnailURL width="20" height="20"$>"
                width="20" height="20"  />
             <$mt:AuthorName$>
           </li>
         </mt:AuthorUserpicAsset>
    </mt:Authors></ul>

AuthorUserpicURL

This template tag returns the fully qualified URL for the userpic of the author currently in context.

If the author has no userpic, this will output an empty string.

B

BlogArchiveURL

Outputs the Archive URL of the blog currently in context. An ending '/' character is guaranteed.

BlogCategoryCount

Returns the number of categories associated with a blog.

If a blog has 4 categories, using the following tag will output “4”:

<mt:BlogCategoryCount>

This template tag also supports all of the same filtering mechanisms defined by the mt:Categories tag allowing users to retrieve a count of the number of comments on a blog that meet a certain criteria.

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:BlogCategoryCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:BlogCategoryCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:BlogCategoryCount none="No entries">

or

<mt:BlogCategoryCount none="None">

Example

<mt:BlogCategoryCount singular="1 category" plural="# categories" none="No category">

This returns

"1 category" or "9 categories" or "No category".

BlogCCLicenseImage

Publishes the URL of the Creative Commons logo appropriate to the license assigned to the blog in context. If the blog doesn't have a Creative Commons license, this tag returns an empty string.

Example:

    <MTIf tag="BlogCCLicenseImage">
    <img src="<$MTBlogCCLicenseImage$>" alt="Creative Commons" />
    </MTIf>

BlogCCLicenseURL

Publishes the license URL of the Creative Commons logo appropriate to the license assigned to the blog in context. If the blog doesn't have a Creative Commons license, this tag returns an empty string.

BlogCommentCount

Returns the number of published comments associated with the blog currently in context.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:BlogCommentCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:BlogCommentCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:BlogCommentCount none="No entries">

or

<mt:BlogCommentCount none="None">

top

if specified, gets a count of comments that do not contain a reply.

Example

<mt:BlogCommentCount singular="1 comment" plural="# comments" none="No comments">

This returns

"1 comment" or "9 comments" or "No comments".

BlogCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

BlogCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

BlogCustomFields

This container tag iterates, or loops, over all custom fields associated with a blog.

See mt:EntryCustomFields for more details.

<mt:BlogCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:BlogCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:BlogCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:BlogCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:BlogCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:BlogCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

BlogCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

BlogDateLanguage

The blog's specified language for date display. This setting can be changed on the blog's Entry settings screen.

Attributes:

This tag has been available since Mvable Type 5.2.6.

BlogDescription

Outputs the description field of the blog currently in context.

BlogEntryCount

Returns the number of published entries associated with the blog currently in context.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:BlogEntryCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:BlogEntryCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:BlogEntryCount none="No entries">

or

<mt:BlogEntryCount none="None">

Example

This returns

"1 entry" or "9 entries" or "No entry".

BlogFileExtension

Returns the configured blog filename extension, including a leading '.' character. If no extension is assigned, this returns an empty string.

BlogHost

The host name part of the absolute URL of your blog. If your blog’s Site URL is set to http://www.my-site.com/my-awesome-blog/, then the BlogHost tag will return http://www.my-site.com/.

Attributes

BlogID

Outputs the numeric ID of the blog currently in context.

BlogIfCCLicense

A conditional tag that is true when the current blog in context has been assigned a Creative Commons License.

BlogIfCommentsOpen

A conditional tag that returns true when: the system is configured to allow comments and the blog is configured to accept comments in some fashion.

BlogLanguage

The blog's specified language for date display. This setting can be changed on the blog's Entry settings screen.

Attributes:

BlogName

Outputs the name of the blog currently in context.

BlogPageCount

The number of published pages in the blog. This template tag supports the multiblog template tags.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:BlogPageCount singular="1 page">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:BlogPageCount plural="# pages">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:BlogPageCount none="No pages">

or

<mt:BlogPageCount none="None">

Example

<$mt:BlogPageCount singular="1 page" plural="# pages" none="No pages"$>

This returns

"1 page" or "9 pages" or "No pages".

BlogParentWebsite

Block tag to retrieve the parent website context from the child blog context.

Example

You can get the parent WebsiteID from the child blog template to include website templates.

<mt:SetVarBlock name="website_id"><mt:BlogParentWebsite><mt:WebsiteID></mt:BlogParentWebsite></mt:SetVarBlock>
<mt:Include module="Website Header" website_id="$website_id">

Note

As of version 5.2.7, the Website context exists within other contexts, obviating the need for this tag in some scenarios. In other words, within the blog context, for example, there is no need to use this tag. The above example can be simplified:

<mt:WebsiteID setvar="website_id">
<mt:Include module="Website Header" website_id="$website_id">

BlogPingCount

Returns a count of published TrackBack pings associated with the blog currently in context.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:BlogPingCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:BlogPingCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:BlogPingCount none="No entries">

or

<mt:BlogPingCount none="None">

Example

<mt:BlogTrackbackCount singular="1 trackback" plural="# trackbacks" none="No trackbacks">

This returns

"1 trackback" or "9 trackbacks" or "No trackbacks".

BlogRelativeURL

Similar to the BlogURL tag, but removes any domain name from the URL.

Note that this tag does not append a trailing slash, if needed, like the BlogURL and BlogSitePath tags do. Bug 110586 has been filed for this minor issue — it can be easily solved by including a trailing slash in the Blog URL configuration.

BlogResultFooter

The contents of this container tag will be displayed when the blog id of the entry in context from search results differs from the next entry's blog id.

This tag is only recognized in search templates.


<mt:SearchResults>
  <mt:SearchResultsHeader>
    <div id="search-results">
      <h1 id="page-title">Search Results</h1>
  </mt:SearchResultsHeader>

  <mt:BlogResultHeader>
    <p>Results from <a href="<$mt:EntryBlogURL$>"><$mt:EntryBlogName$></a></p>
  </mt:BlogResultHeader>

    <$mt:Include module="Entry Summary"$>

  <mt:BlogResultFooter>
    <p>End of <a href="<$mt:EntryBlogURL$>"><$mt:EntryBlogName$></a></p>
  </mt:BlogResultFooter>

  <mt:SearchResultsFooter>
    </div>
  </mt:SearchResultsFooter>
</mt:SearchResults>

BlogResultHeader

The contents of this container tag will be displayed when the blog id of the entry in context from search results differs from the previous entry's blog id.

This tag is only recognized in search templates.


<mt:SearchResults>
  <mt:SearchResultsHeader>
    <div id="search-results">
      <h1 id="page-title">Search Results</h1>
  </mt:SearchResultsHeader>

  <mt:BlogResultHeader>
    <p>Results from <a href="<$mt:EntryBlogURL$>"><$mt:EntryBlogName$></a></p>
  </mt:BlogResultHeader>

    <$mt:Include module="Entry Summary"$>

  <mt:BlogResultFooter>
    <p>End of <a href="<$mt:EntryBlogURL$>"><$mt:EntryBlogName$></a></p>
  </mt:BlogResultFooter>

  <mt:SearchResultsFooter>
    </div>
  </mt:SearchResultsFooter>
</mt:SearchResults>

Blogs

A container tag which iterates over a list of all of the blogs in the system. You can use any of the blog tags (such as BlogName, BlogURL, etc — anything starting with “Blog”) inside of this tag set.

Attributes

Example

The following will list the name and URL to all blogs in the system.

<mt:Blogs>
    <p><mt:BlogName>: <mt:BlogURL></p>
</mt:Blogs>

The list of blogs can be reduced to only those requested using the above attributes, such as include_blogs. Note that the blogs are returned in alphabetical order, sorted by blog name.

<mt:Blogs include_blogs="1,2,7">
    <p><mt:BlogName>: <mt:BlogURL></p>
</mt:Blogs>

BlogSitePath

Outputs the Site Root field of the blog currently in context. An ending '/' character is guaranteed.

BlogTemplateSetID

Returns an identifier for the currently assigned template set for the blog in context. The identifier is modified such that underscores are changed to dashes. In the MT template sets, this identifier is assigned to the "id" attribute of the body HTML tag.

BlogThemeID

Outputs the ID of the theme currently applied to the blog in context. The identifier is modified such that underscores are changed to dashes.

Modifiers

BlogTimezone

The timezone that has been specified for the blog displayed as an offset from UTC in +|-hh:mm format. This setting can be changed on the blog's General settings screen.

Attributes:

BlogURL

Outputs the Site URL field of the blog currently in context. An ending '/' character is guaranteed.

BuildTemplateID

Returns the ID of the template (index, archive or system template) currently being built.

Examples

Publish “edit” links in index templates:

<a href="<$mt:AdminCGIPath$><$mt:AdminScript$>?__mode=view&_type=template&id=<$mt:BuildTemplateID$>&blog_id=<$mt:BlogID$>">Edit</a>

C

Calendar

A container tag representing a calendar month that lists a single calendar "cell" in the calendar display.

Attributes:

Example:

To produce a calendar for January, 2002 of entries in the category "Foo":

    <mt:Calendar month="200201" category="Foo">
        ...
    </mt:Calendar>

CalendarCellNumber

The number of the "cell" in the calendar, beginning with 1. The count begins with the first cell regardless of whether a day of the month falls on it. This tag may only be used inside a Calendar tag.

Example:

    <$mt:CalendarCellNumber$>

CalendarDate

The timestamp of the current day of the month. Date format tags may be applied with the format attribute along with the language attribute.

Example:

    <$mt:CalendarDate$>

CalendarDay

The numeric day of the month for the cell of the calendar being published. This tag may only be used inside a Calendar tag.

Example:

    <$mt:CalendarDay$>

CalendarIfBlank

A conditional tag that will display its contents if the current calendar cell is for a day in another month.

Example:

    <mt:CalendarIfBlank>&nbsp;</mt:CalendarIfBlank>

CalendarIfEntries

A conditional tag that will display its contents if there are any entries for this day in the blog.

Example

<mt:CalendarIfEntries>
    <mt:Entries limit="1">
    <a href="<$mt:ArchiveLink type="Daily"$>">
        <$mt:CalendarDay$>
    </a>
    </mt:Entries>
</mt:CalendarIfEntries>

Related

CalendarIfNoEntries

A conditional tag that will display its contents if there are not entries for this day in the blog. This tag predates the introduction of Else, a tag that could be used with CalendarIfEntries to replace CalendarIfNoEntries.

CalendarIfToday

A conditional tag that will display its contents if the current cell is for the current day.

CalendarWeekFooter

A conditional tag that will display its contents before a calendar week is ended.

Example:

    <mt:CalendarWeekFooter></tr></mt:CalendarWeekFooter>

CalendarWeekHeader

A conditional tag that will display its contents before a calendar week is started.

Example:

    <mt:CalendarWeekHeader><tr></mt:CalendarWeekHeader>

CanonicalLink

Used within the index template and archive template to designate the URL, including the page link, of the current page. This tag can be used with all archive types.

When used in an index template, the blog or website URL is returned.

When used in an archive template, the URL of the page currently being processed is returned.

Usage

<$MTCanonicalLINK$>
produces
<link rel="canonical" href="http://example.com/blog/" />

Modifier

with_index="0"
If the value is set to 1, the returned URL will use the index file name (usually index.html).
If a value other than 1 is used, the index file name will not be used.
The default value is 0.
current_mapping="0"
If the value is set to 1, the current context URL will be returned.
If a value other than 1 is used, and if multiple archive mappings are set within the template, then the highest priority mapping URL will be returned.
The default value is 0.

This tag has been available since Mvable Type 5.2.6.

CanonicalURL

Used within the index template and archive template to designate the URL of the current page. This tag can be used with all archive types.

When used in an index template, the blog or website URL is returned.

When used in an archive template, the URL of the page currently being processed is returned.

Usage

<link rel="canonical" href="<$MTCanonicalURL$>">
produces
<link rel="canonical" href="http://example.com/blog/" />

Modifier

with_index="0"
If the value is set to 1, the returned URL will use the index file name (usually index.html).
If a value other than 1 is used, the index file name will not be used.
The default value is 0.
current_mapping="0"
If the value is set to 1, the current context URL will be returned.
If a value other than 1 is used, and if multiple archive mappings are set within the template, then the highest priority mapping URL will be returned.
The default value is 0.

This tag has been available since Mvable Type 5.2.6.

CaptchaFields

Returns the HTML markup necessary to display the CAPTCHA on the published blog. The value returned is escaped for assignment to a JavaScript string, since the CAPTCHA field is displayed through the MT JavaScript code.

Example:

    var captcha = '<$mt:CaptchaFields$>';

Categories

Produces a list of categories defined for the current blog.

Categories in this blog:
<mt:Categories glue=", ">
    <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a>
</mt:Categories>

This tag produces output for every category with no regard to their hierarchical structure. The results are sorted ascending by category label.

The tags mt:TopLevelCategories and mt:SubCategories may be more useful for complex listings of categories.

Attributes

MultiBlog attributes

glue

A string used to join the output of the separate iterations of MTCategories. This can be as simple as a comma and space (“, ”) to list out category labels or complex HTML markup to be inserted between the markup generated by MTCategories.

lastn

Limits output to the first N categories. N is a positive integer.

show_empty

Setting this optional attribute to true (1) will include categories with no entries assigned. The default is false (0), where only categories with entries assigned.

Examples

List out the categories used on at least one blog entry, separated by commas:

Categories: <mt:Categories glue=", "><$mt:CategoryLabel$></mt:Categories>

List all categories and link to categories if the category has one or more entries:

<mt:Categories show_empty="1">
    <mt:If name="__first__">
<ul>
    </mt:If>
    <mt:If tag="CategoryCount" gte="1">
    <li><a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
    <mt:Else>
    <li><$mt:CategoryLabel$></li>
    </mt:If>
    <mt:If name="__last__">
</ul>
    </mt:If>
</mt:Categories>

Related

CategoryArchiveLink

Deprecated: Use <$mt:ArchiveLink$>

A link to the archive page of the current category. Should be used in the context of a Category archive template.

Example

In a Category-Monthly archive template, use the following code to create a link the name of the current category to the main category page:

<a href="<$mt:CategoryArchiveLink$>">Main page for <$mt:CategoryName$> category</a>

CategoryBasename

Produces the dirified basename defined for the category in context.

Attributes

default

A value to use in the event that no category is in context.

separator

Valid values are dash “-” (default) and underscore “_”. Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.

Example

If the basename of the category “News & Press” is news_press then this tag will output the dashed version news-press:

<$mt:CategoryBasename separator="-"$>

For an overview of how to use category tags like mt:CategoryBasename, check out Managing Categories in Movable Type.

CategoryCommentCount

Returns the number of comments associated to entries within the category in context.

Attributes

top

if specified, gets a count of comments that do not contain a reply.

Example

List of categories with the comment counts:

<ul>
<mt:Categories>
    <mt:If tag="CategoryCommentCount">
    <li>
        <a href="<$mt:ArchiveLink type="Category"$>"><$mt:CategoryLabel$></a> (Comments: <$mt:CategoryCommentCount$>)
    </li>
    </mt:If>
</mt:Categories>
</ul>

CategoryCount

The number of published entries for the category in context.

Attributes

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:CategoryCount singular="1 category">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:CategoryCount plural="# categories">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:CategoryCount none="No categories">

or

<mt:CategoryCount none="None">

Example

A simple example using the count attributes:

This returns

"1 category" or "9 categories" or "No category".

List categories containing entries with a count:

<ul>
<mt:Categories>
    <li>
        <a href="<mt:ArchiveLink type="Category">">
            <mt:CategoryLabel></a> (<mt:CategoryCount>)
    </li>
</mt:Categories>
</ul>

List categories named “Bug Fixes” along with the number of published articles:

<mt:Categories>
    <mt:If tag="CategoryLabel" eq="Bug Fixes">
        <mt:CategoryLabel> has
            <mt:CategoryCount singular="1 article"
                plural="# articles" none="No articles">.
    </mt:If>
</mt:Categories>

CategoryCustomFieldDescription

Deprecated: Same as mt:CustomFieldDescription. See EntryCustomFields for more info.

This will display the description of the current custom field in context.

CategoryCustomFieldName

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

CategoryCustomFields

This container tag iterates, or loops, over all custom fields associated with a category.

See mt:EntryCustomFields for more details.

<mt:Categories>
    <mt:CategoryCustomFields>
        <$mt:CustomFieldName$>
    </mt:CategoryCustomFields>
</mt:Categories>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:CategoryCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:CategoryCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:CategoryCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:CategoryCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

CategoryCustomFieldValue

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

CategoryDescription

The description for the category in context.

Example

List categories with descriptions:

<dl>
<mt:Categories>
    <dt>
        <$mt:CategoryLabel$>
    </dt>
    <dd>
        <$mt:CategoryDescription$>
    </dd>
</mt:Categories>
</dl>

CategoryID

The numeric system ID of the category.

Example

List categories with category IDs:

<dl>
<mt:Categories>
    <dt>
        <$mt:CategoryLabel$>
    </dt>
    <dd>
        <$mt:CategoryID$>
    </dd>
</mt:Categories>
</dl>

CategoryIfAllowPings

A conditional tag that displays its contents if pings are enabled for the category in context.

On the Edit Category screen there is a checkbox for “Accept Trackbacks”

Use the mt:Pings loop to list the pings for a category.

Example

Display the count of trackbacks for the category in context and the trackback link:

<mt:CategoryIfAllowPings>
  <!-- do something -->
  <$mt:CategoryTrackbackCount$>
  <$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>

CategoryLabel

The label of the category in context. The current category in context can be placed there by either the following contexts (in order of precedence):

Example

List all Category Labels linked their respective category archives:

<ul>
<mt:Categories>
    <li>
        <a href="<$mt:ArchiveLink type="Category"$>"><$mt:CategoryLabel$></a>
    </li>
</mt:Categories>
</ul>

Tip: Due to legacy taging the mt:EntryCategory function tag will output the same value as the mt:FolderLabel function tag when used in the context of a page. Unlike the mt:PageFolder tag which is block tag and must be used with the mt:FolderLabel tag.

Use this mtml

 <mt:If tag="EntryCategory" eq="Appendix: Configuration Directives">
   This main folder for this page is "Appendix: Configuration Directives".
   Confirmation using `mt:EntryCategory`: "<$mt:EntryCategory$>".
 </mt:If>

CategoryNext

A container tag which creates a category context of the next category relative to the current entry category or archived category.

<mt:CategoryNext>
    <a href="<MTArchiveLink archive_type="Category">"><MTCategoryLabel></a>
</mt:CategoryNext>

If the current category has sub-categories, then CategoryNext will generate a link to the next sibling category. For example, in the following category hierarchy:

If the current category is “News” then CategoryNext will link to “Events”.

If the current category is “Palo Alto” then CategoryNext will link to “San Francisco”.

If the current category is “Sports” then CategoryNext will be empty as there is no next category. A link to the next category is not availble for the last category in a list and a link to previous category is not available for the first category.

Here’s an example showing the relationships between categories when determining mt:CategoryNext and mt:CategoryPrevious.

Attributes

show_empty

Specifies whether categories with no entries assigned should be counted and displayed.

Examples

List the previous and next for a recursive category list, showing empty categories too:

<mt:SubCategories top="1">
    <mt:SubCatIsFirst>
        <ul>
    </mt:SubCatIsFirst>
            <li>
                <a href="<$mt:CategoryArchiveLink$>" title="<$mt:CategoryDescription$>"><$mt:CategoryLabel$></a>
                <ul>
    <mt:CategoryNext show_empty="1">
                <li>CategoryNext: <a href="<$mt:ArchiveLink archive_type="Category"$>"><$mt:CategoryLabel$></a></li>
    </mt:CategoryNext>
    <mt:CategoryPrevious show_empty="1">
                <li>CategoryPrev: <a href="<$mt:ArchiveLink archive_type="Category"$>"><$mt:CategoryLabel$></a></li>
    </mt:CategoryPrevious>
                </ul>
    <$mt:SubCatsRecurse$>
            </li>
    <mt:SubCatIsLast>
        </ul>
    </mt:SubCatIsLast>
</mt:SubCategories>

CategoryPrevious

A container tag which creates a category context of the previous category relative to the current entry category or archived category.

<mt:CategoryPrevious>
    <a href="<$mt:ArchiveLink archive_type="Category"$>"><$mt:CategoryLabel$></a>
</mt:CategoryPrevious>

If the current category has sub-categories, then CategoryPrevious will generate a link to the previous sibling category.

See mt:CategoryNext for more documentation on this tag.

Attributes

show_empty

Specifies whether categories with no entries assigned should be counted.

Example

See mt:CategoryNext for more examples of mt:CategoryPrevious usage.

CategoryTrackbackCount

The number of published TrackBack pings for the category in context.

Use the mt:Pings loop to list the pings for a category.

Example

Display the count of trackbacks for the category in context and the trackback link:

<mt:CategoryIfAllowPings>
  <!-- do something -->
  <$mt:CategoryTrackbackCount$>
  <$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>

CategoryTrackbackLink

The URL that TrackBack pings can be sent to for the category in context.

Use the mt:Pings loop to list the pings for a category.

Example

Display the count of trackbacks for the category in context and the trackback link:

<mt:CategoryIfAllowPings>
  <!-- do something -->
  <$mt:CategoryTrackbackCount$>
  <$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>

CCLicenseRDF

Returns the RDF markup for a Creative Commons License. If the blog has not been assigned a license, this returns an empty string.

Attributes:

CGIHost

Returns the domain host from the configuration directive CGIPath. If CGIPath is defined as a relative path, then the domain is derived from the Site URL in the blog's "Publishing Settings".

Attributes:

CGIPath

The value of the CGIPath configuration directive. The output is guaranteed to end with a /.

This generates an absolute URL, including a domain name (even if CGIPath is set to a relative URL). If you need a relative URL, use CGIRelativeURL.

CGIRelativeURL

The relative URL (path) extracted from the CGIPath setting in mt-config.cgi. This is the same as CGIPath, but without any domain name. This value is guaranteed to end with a "/" character.

CGIServerPath

Returns the file path to the directory where Movable Type has been installed. Any trailing "/" character is removed.

CommentAuthor

Outputs the name field of the current comment in context (for comments left by authenticated users, this will return their display name).

CommentAuthorIdentity

Returns a profile icon link for the current commenter in context. The icon is for the authentication service used (ie, TypeKey, OpenID, Vox LiveJournal, etc.). If the commenter has a URL in their profile the icon is linked to that URL.

CommentAuthorLink

A linked version of the comment author name, using the comment author's URL if provided in the comment posting form. Otherwise, the comment author name is unlinked. This behavior can be altered with optional attributes.

Attributes:

CommentBlogID

Outputs the numeric ID of the blog for the current comment in context.

CommentBody

Attributes:

CommentCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

CommentCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

CommentCustomFields

This container tag iterates, or loops, over all custom fields associated with a comment.

See mt:EntryCustomFields for more details.

<mt:CommentCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:CommentCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:CommentCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:CommentCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:CommentCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:CommentCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

CommentCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

CommentDate

Outputs the creation date for the current comment in context. See the Date tag for support attributes.

CommentEmail

Publishes the commenter's e-mail address.

NOTE: It is not recommended to publish any email addresses.

Attributes:

CommentEntry

A block tag that can be used to set the parent entry of the comment in context.

Example

    <mt:Comments lastn="4">
        <$mt:CommentAuthor$> left a comment on
        <mt:CommentEntry><$mt:EntryTitle$></mt:CommentEntry>.
    </mt:Comments>

CommentEntryID

Outputs the numeric ID for the parent entry (or page) of the current comment in context.

CommenterAuthIconURL

Returns URL to a small (16x16) image represents in what authentication provider the commenter in context is authenticated. Commenter context is created by either a Comments or CommentReplies block tag. For commenters authenticated by Movable Type, it will be a small spanner logo of Movable Type. Otherwise, icon image is provided by each of authentication provider. Movable Type provides images for Vox, LiveJournal and OpenID out of the box.

Example:

    <mt:Comments>
        <$mt:CommenterName$><$mt:CommenterAuthIconURL$>:
        <$mt:CommentBody$>
    </mt:Comments>

CommenterAuthType

Returns a string which identifies what authentication provider the commenter in context used to authenticate him/herself. Commenter context is created by either MTComments or MTCommentReplies template tag. For example, 'MT' will be returned when the commenter in context is authenticated by Movable Type. When the commenter in context is authenticated by Vox, 'Vox' will be returned.

Example:

    <mt:Comments>
      <$mt:CommenterName$> (<$mt:CommenterAuthType$>) said:
      <$mt:CommentBody$>
    </mt:Comments>

CommenterEmail

The email address of the commenter. The spam_protect global filter may be used.

Example:

    <$mt:CommenterEmail$>

CommenterID

Outputs the numeric ID of the current commenter in context.

CommenterIfTrusted

Deprecated in favor of the IfCommenterTrusted tag.

CommenterName

The name of the commenter for the comment currently in context.

Example:

    <$mt:CommenterName$>

CommenterNameThunk

Used to populate the commenter_name Javascript variable. Deprecated in favor of the UserSessionState tag.

CommenterURL

Outputs the URL from the profile of the current commenter in context.

CommenterUsername

This template tag returns the username of the current commenter in context. If no name exists, then it returns an empty string.

Example:

    <mt:Entries>
        <h1><$mt:EntryTitle$></h1>
        <mt:Comments>
            <a name="comment-<$mt:CommentID$>"></a>
            <p><$mt:CommentBody$></p>
            <cite><a href="/profiles/<$mt:CommenterID$>"><$mt:CommenterUsername$></a></cite>
        </mt:Comments>
    </mt:Entries>

CommenterUserpic

This template tag returns a complete HTML img tag for the current commenter's userpic. For example:

    <img src="http://yourblog.com/userpics/1.jpg" width="100" height="100" />

Example:

    <h2>Recent Commenters</h2>
    <mt:Entries recently_commented_on="10">
        <div class="userpic" style="float: left; padding: 5px;"><$mt:CommenterUserpic$></div>
    </mt:Entries>

CommenterUserpicAsset

This template tag is a container tag that puts the current commenter's userpic asset in context. Because userpics are stored as assets within Movable Type, this allows you to utilize all of the asset-related template tags when displaying a user's userpic.

Example:

     <mt:CommenterUserpicAsset>
        <img src="<$mt:AssetThumbnailURL width="20" height="20"$>"
            width="20" height="20"  />
     </mt:CommenterUserpicAsset>

CommenterUserpicURL

This template tag returns the URL to the image of the current commenter's userpic.

Example:

    <img src="<$mt:CommenterUserpicURL$>" />

CommentFields

A deprecated tag that formerly published an entry comment form.

CommentID

Outputs the numeric ID for the current comment in context.

CommentIfModerated

Conditional tag for testing whether the current comment in context is moderated or not (used for application, email and comment response templates where the comment may not actually be published).

CommentIP

Outputs the IP address where the current comment in context was posted from.

CommentLink

Outputs the permalink for the comment currently in context. This is the permalink for the parent entry, plus an anchor for the comment itself (in the format '#comment-ID').

CommentName

Deprecated in favor of the CommentAuthor tag.

CommentOrderNumber

Outputs a number relating to the position of the comment in the list of all comments published using the Comments tag, starting with "1".

CommentParent

A block tag that can be used to set the parent comment of the current comment in context. If the current comment has no parent, it produces nothing.

Example:

    <mt:CommentParent>
        (a reply to <$mt:CommentAuthor$>'s comment)
    </mt:CommentParent>

CommentParentID

Outputs the ID of the parent comment for the comment currently in context. If there is no parent comment, outputs '0'.

Attributes:

CommentPreviewAuthor

A deprecated tag, replaced with CommentAuthor.

CommentPreviewAuthorLink

A deprecated tag, replaced with CommentAuthorLink.

CommentPreviewBody

A deprecated tag, replaced with CommentBody.

CommentPreviewDate

A deprecated tag, replaced with CommentDate.

CommentPreviewEmail

A deprecated tag, replaced with CommentEmail.

CommentPreviewIP

A deprecated tag, replaced with CommentIP.

CommentPreviewIsStatic

For the comment preview template only.

CommentPreviewState

For the comment preview template only.

CommentPreviewURL

A deprecated tag, replaced with CommentURL.

CommentRank

A function tag which returns a number from 1 to 6 (by default) which represents the rating of the comment in context in terms of total score where '1' is used for the highest score, '6' for the lowest score.

Attributes:

Example:

    <$mt:CommentRank namespace="FiveStarRating"$>

CommentReplies

A block tag which iterates over a list of reply comments to the in context.

Example:

    <mt:Comment>
      <mt:CommentReplies>
        <mt:CommentsHeader>Replies to the comment:</mt:CommentsHeader>
        <$mt:CommentBody$>
      </mt:CommentReplies>
    </mt:Comment>

CommentRepliesRecurse

Recursively call the block with the replies to the comment in context. This tag, when placed at the end of loop controlled by MTCommentReplies tag will cause them to recursively descend into any replies to comments that exist during the loop.

Example:

    <mt:Comments>
      <$mt:CommentBody$>
      <mt:CommentReplies>
        <mt:CommentsHeader><ul></MTCommentsHeader>
        <li><$mt:CommentID$>
        <$mt:CommentRepliesRecurse$>
        </li>
        <mt:CommentsFooter></ul></mt:CommentsFooter>
      </mt:CommentReplies>
    </mt:Comments>

CommentReplyToLink

Produces the "Reply" link for the current comment in context. By default, this relies on using the MT "Javascript" default template, which supplies the mtReplyCommentOnClick function.

Attributes:

Comments

A container tag which iterates over a list of comments on an entry or for a blog. By default, all comments in context (meaning all the comments for that particular entry or in a blog) are returned. If you use it in a blog context, only comments on published entries are returned.

You can view a list of all comment-related template tags for an idea of the flexibility available in publishing comments. And the following attributes will let you custom-tailor the mt:Comments tag to show exactly the the comments you are selecting.

Attributes

Example

In an entry context, display a simple list of comments. (Note that this is a simple example: a more capable comment display is much longer; refer to the theme templates supplied with Movable Type for longer examples with complete HTML.)

<mt:Comments>
<div>
    <p>A comment left by <mt:CommenterName></p>
    <mt:CommentBody format="markdown">
</div>
</mt:Comments>

CommentScore

A function tag that provides total score of the comment in context. Scores grouped by namespace of a plugin are summed to calculate total score of a comment.

Attributes:

Example:

    <$mt:CommentScore namespace="FiveStarRating"$>

CommentScoreAvg

A function tag that provides the avarage score of the comment in context. Scores grouped by namespace of a plugin are summed to calculate total score of a comment, and average is calculated by dividing the total score by the number of scorings or 'votes'.

Attributes:

Example:

    <$mt:CommentScoreAvg namespace="FiveStarRating"$>

CommentScoreCount

A function tag that provides the number of scorings or 'votes' made to the comment in context. Scorings grouped by namespace of a plugin are summed.

Attributes:

Example:

    <$mt:CommentScoreCount namespace="FiveStarRating"$>

CommentScoreHigh

A function tag that provides the highest score of the comment in context. Scorings grouped by namespace of a plugin are sorted to find the highest score of a comment.

Attributes:

Example:

    <$mt:CommentScoreHigh namespace="FiveStarRating"$>

CommentScoreLow

A function tag that provides the lowest score of the comment in context. Scorings grouped by namespace of a plugin are sorted to find the lowest score of a comment.

Attributes:

Example:

    <$mt:CommentScoreLow namespace="FiveStarRating"$>

CommentScript

Returns the value of the CommentScript configuration setting. The default for this setting if unassigned is "mt-comments.cgi".

CommentsFooter

The contents of this container tag will be displayed when the last comment listed by a Comments or CommentReplies tag is reached.

CommentsHeader

The contents of this container tag will be displayed when the first comment listed by a Comments or CommentReplies tag is reached.

CommentURL

Outputs the URL of the current comment in context. The URL is the link provided in the comment from an anonymous comment, or for authenticated comments, is the URL from the commenter's profile.

ConfigFile

Returns the full file path for the Movable Type configuration file (mt-config.cgi).

ContentFieldFooter

Use within the MTContentField tag. This is a block tag that executes only if it is the last value in the MTContentField tag.

<mt:ContentFields>
  <mt:ContentFieldsHeader>
    <div>
  </mt:ContentFieldsHeader>
  <mt:ContentField>
    <mt:ContentFieldHeader>
      <ul>
        <li><mt:ContentFieldLabel>
          <ul>
    </mt:ContentFieldHeader>
          <li><mt:ContentFieldValue></li>
    <mt:ContentFieldFooter>
          </ul>
        </li>
      </ul>
    </mt:ContentFieldFooter>
  </mt:ContentField>
  <mt:ContentFieldsFooter>
    </div>
  </mt:ContentFieldsFooter>
</mt:ContentFields>

ContentFieldHeader

Use within the MTContentField tag. This is a block tag that executes only if it is the first value of the MTContentField tag.

<mt:ContentFields>
  <mt:ContentFieldsHeader>
    <div>
  </mt:ContentFieldsHeader>
  <mt:ContentField>
    <mt:ContentFieldHeader>
      <ul>
        <li><mt:ContentFieldLabel>
          <ul>
    </mt:ContentFieldHeader>
          <li><mt:ContentFieldValue></li>
    <mt:ContentFieldFooter>
          </ul>
        </li>
      </ul>
    </mt:ContentFieldFooter>
  </mt:ContentField>
  <mt:ContentFieldsFooter>
    </div>
  </mt:ContentFieldsFooter>
</mt:ContentFields>

ContentFieldLabel

Use within the MTContentField tag. Outputs the name of the content field in the current context.

<mt:ContentFields>
  <mt:ContentFieldsHeader>
    <div>
  </mt:ContentFieldsHeader>
  <mt:ContentField>
    <mt:ContentFieldHeader>
      <ul>
        <li><mt:ContentFieldLabel>
          <ul>
    </mt:ContentFieldHeader>
          <li><mt:ContentFieldValue></li>
    <mt:ContentFieldFooter>
          </ul>
        </li>
      </ul>
    </mt:ContentFieldFooter>
  </mt:ContentField>
  <mt:ContentFieldsFooter>
    </div>
  </mt:ContentFieldsFooter>
</mt:ContentFields>

ContentFieldsFooter

This is a block tag that only runs on the last field within the MTContentFields tag.

<mt:ContentFields>
  <mt:ContentFieldsHeader>
    <div>
  </mt:ContentFieldsHeader>
  <mt:ContentField>
    <mt:ContentFieldHeader>
      <ul>
        <li><mt:ContentFieldLabel>
          <ul>
    </mt:ContentFieldHeader>
          <li><mt:ContentFieldValue></li>
    <mt:ContentFieldFooter>
          </ul>
        </li>
      </ul>
    </mt:ContentFieldFooter>
  </mt:ContentField>
  <mt:ContentFieldsFooter>
    </div>
  </mt:ContentFieldsFooter>
</mt:ContentFields>

ContentFieldsHeader

This is a block tag that only runs on the first field within the MTContentFields tag.

<mt:ContentFields>
  <mt:ContentFieldsHeader>
    <div>
  </mt:ContentFieldsHeader>
  <mt:ContentField>
    <mt:ContentFieldHeader>
      <ul>
        <li><mt:ContentFieldLabel>
          <ul>
    </mt:ContentFieldHeader>
          <li><mt:ContentFieldValue></li>
    <mt:ContentFieldFooter>
          </ul>
        </li>
      </ul>
    </mt:ContentFieldFooter>
  </mt:ContentField>
  <mt:ContentFieldsFooter>
    </div>
  </mt:ContentFieldsFooter>
</mt:ContentFields>

CurrentPage

A function tag returns a number represents the number of current page. The number starts from 1.

CustomFieldBasename

Returns the basename entered when custom field was created for the object in context.

<$mt:CustomFieldBasename$>

The value must be unique among all other custom field basenames.

See mt:EntryCustomFields for more documentation.

Related

CustomFieldDescription

Returns the description entered when custom field was created for the object in context.

<$mt:CustomFieldDescription$>

See mt:EntryCustomFields for more documentation.

Related

CustomFieldIsRequired

A conditional tag that is true when the custom field has been configured as required.

CustomFieldName

Returns the name or "label" entered when custom field was created for the object in context.

<$mt:CustomFieldName$>

See mt:EntryCustomFields for more documentation.

Related

CustomFieldValue

Returns the value selected or data entered on the "Edit" screen for the object in context.

<$mt:CustomFieldValue$>

See mt:EntryCustomFields for more documentation.

Related

D

DataAPIVersion

Retrieves the Data API’s latest version number.

Date

Outputs the current date.

Attributes

Examples

Format YYYY-MM-DD (2009-05-22, for example)

<mt:Date format="%Y-%m-%d">

Format Day of Week, Month DD, YYYY (Friday, May 22, 2009)

<mt:Date format="%A, %b %e, %Y">

This tag is particularly useful to output a date stamp for a copyright notice. If this notice is included on a Template Module (perhaps a “footer”) using a Server Side Include option (such as PHP) the date will remain correct and update any time content is published.

Copyright 2007-<mt:Date format="%Y">, all rights reserved.

More examples:

<mt:Date utc=1>

<mt:Date relative="js">

<mt:Date format_name="rfc822">

Combinations:

<mt:Date utc=1 relative="js" format_name="rfc822">

DateFooter

A container tag whose contents will be displayed if the entry in context is the last entry in the group of entries for a given day.

Example:

    <mt:Entries>
        <!-- display entry here -->
        <mt:DateFooter>
            <hr />
        </mt:DateFooter>
    </mt:Entries>

DateHeader

A container tag whose contents will be displayed if the entry in context was posted on a new day in the list.

Example

    <mt:Entries>
        <mt:DateHeader>
            <h2><$mt:EntryDate format="%A, %B %e, %Y"$></h2>
        </mt:DateHeader>

        <h3><mt:EntryTitle></h3>
        <mt:EntryBody>
    </mt:Entries>

DefaultLanguage

The value of the DefaultLanguage configuration setting.

Example:

    <$mt:DefaultLanguage$>

This outputs a language code, ie: "en_US", "ja", "de", "es", "fr", "nl" or other installed language.

E

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

Simple if-else use:

<mt:If name="fruit">
    'fruit' is assigned
<mt:Else>
    'fruit' is not assigned
</mt:If>

Else can also be used to test for multiple values:

<mt:If name="fruit" eq="apple">
    It's an apple!
<mt:Else name="apple" eq="banana">
    It's a banana!
<mt:Else>
    It's not an apple or banana, but it is a fruit!
</mt:If>

ElseIf

An alias for the 'Else' tag.

Entries

A block tag which iterates over a list of published entries from a blog and outputs a selection of entries that are appropriate for the context used and the template being published.

The <mt:Entries> tag is one of the most basic tags you’ll use in working with Movable Type. Put simply, you open and close the <mt:Entries> and </mt:Entries> tags, and in between, Movable Type will loop through all of your entries, displaying the information you’ve chosen in the format you desire.

<mt:Entries>
    <$mt:EntryTitle$>
    <$mt:EntryBody$>
</mt:Entries>

Nearly every template uses <mt:Entries> in one way or another because this tag is so powerful. You can add in attributes to specify exactly which entries to show on your page. Attributes can be used in combination to sort, select, and filter entries exactly as desired. Be sure to check out the examples.

The default behavior is set according to the “Entry Listing Default” and “Entry Order” preferences in the Entry Settings. The attributes days, lastn, and sort_order attributes override their corresponding settings in the blog’s General settings menu.

Used without any attributes, <mt:Entries> will output entries based upon the context in which it is used:

Note: author and category archive mappings are limited to the value set for “Entry Listing Default” preference in the Entry Settings. Without this default, these archives could take progressively longer and longer to publish. You can override this default with the lastn attribute.

The <mt:Entries> tag can be placed in custom modules, index templates and widgets to select content in many different ways.

The output <mt:Entries> can be affected by mt:Entry tag attributes and template tag modifiers.

Beware that the ordered combination of attributes and modifiers can affect the output of <mt:Entries>.

Attributes

All <mt:Entries> attributes are optional. The most common attributes are:

MultiBlog attributes

author

Accepts an author’s username to filter entry selection. (The username is the one you log in with, not the fancy Display Name if you’ve set that in your profile.)

<mt:Entries author="melody">

Tip: To dynamically apply the author username use variable interpolation with the mt:EntryAuthorUsername tag (when in entry context):

<$mt:EntryAuthorUsername setvar="entry_author_username"$>
<mt:Entries author="$entry_author_username">
  <li><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li>
</mt:Entries>

category

This attribute allows you to filter the entries based on category assignment. The simple case is to filter for a single category, where the full category name is specified:

<mt:Entries category="Featured">

Multiple categories with the same name can be differentiated using their parent category names to be more explicit:

<mt:Entries category="News/Featured">

or

<mt:Entries category="Projects/Featured">

Advanced Boolean logic is supported in category and tag attributes (AND, OR, NOT, parenthetical grouping) to include or exclude categories:

<mt:Entries category="(Family OR Pets) AND Featured">

or

<mt:Entries category="((Cats AND Dogs) OR General) AND NOT Private">

or

<mt:Entries category="NOT Family">

categories

Alias of category.

days

Filters all posts less than N days old (the date when the page is published). N is a positive number, typically an integer.

The days attribute should be used separately from other attributes. If used with another attribute, days is ignored.

To display all entries with a publish date in the last 10 days, use this:

<mt:Entries days="10">

Set a number of days to be the default behavior for the <mt:Entries> tag in the “Entry Listing Default” preference in the Entry Settings

Additionally, the days attribute can be used in an obscure way with a very small value that can be set to “0.0000000000001” to force only future (non-today) entries to publish, as explained by Maarten Schenk of Movable Tips. (Setting the value to “0” does not have the same effect.)

field:basename

Permits filtering entries based on a custom field defined (custom fields are part of the Commercial Pack in MT 4.0 and 4.1, and are built in to MT Pro from version 4.2 on.).

Select the last 5 entries that have a check box custom field with a basename of “subscribe” which is checked:

<mt:Entries field:subscribe="1" sort_by="authored_on" sort_order="descend" limit="5">

glue

A string that is output between published entries. Use it to comma-separate items, to add spaces or tabs, or to do even more complicated things.

Output a comma-separated list of entry ids (i.e. 3,2,1):

<mt:Entries glue=","><$mt:EntryID$></mt:Entries>

id

Outputs a single entry matching the given entry ID.

<mt:Entries id="33">

include_subcategories

Boolean value, 1 or 0 (default). If specified in conjunction with the category (or categories) attribute, entries assigned to subcategories of the identified category/categories will be included.

lastn

Display the last N posts of the blog. N is a positive integer.

This attribute implies selection of entries based on their “authored” date (“Published Date” in the app), in reverse chronological order.

Movable Type will follow the value for “Entry Listing Default” preference in the Entry Settings if this attribute is not provided.

A value of “0” (zero) will output all entries.

Publish the 5 most recent entries, ordered by their title:

<mt:Entries lastn="5" sort_by="title" sort_order="ascend">

Note: when sorting use the limit attribute; when using lastn it is assumed that recent entries are desired.

limit

Used in Entry Listing archive templates or when sorting by a value other than by publish date. Can be a positive integer or “auto” (note that this value is case-sensitive), which defaults to the “Entry Listing Default” preference in the Entry Settings. Similar to the lastn attribute.

max_score

Returns entries with a score lower than the max_score value for the given namespace (required) for the scoring framework.

min_score

Returns entries with a score higher than the min_score value for the given namespace (required) for the scoring framework.

max_rate

Returns entries with a rate with the highest average score for the given namespace (required) for the scoring framework.

min_rate

Returns entries with the lowest average score for the given namespace (required) for the scoring framework.

max_count

Returns entries with which have been scored the most number of times (with any score) for the given namespace (required) for the scoring framework.

min_count

Returns entries with which have been scored the least number of times (with any score) for the given namespace (required) for the scoring framework.

namespace

Used to specify which scoring framework namespace to use when sorting by score (sort_by=”score”) or filtering based by score (max_score, min_score, max_rate, min_rate, max_count, min_count).

The MT Community Pack provides a community_pack_recommend namespace, for instance, which can be used to select entries, sorting by number of “recommend” or “favorite” scores that have been submitted.

offset

Used in coordination with lastn, starts N entries from the start of the list.

If dynamic publishing has been enabled, N is a positive integer or the keyword “auto” (note that this value is case-sensitive) to automatically determine the offset based on the offset query parameter for the request.

This code will place the first three entries in heading 2 tags and then place the rest in an unordered list:

<mt:Entries lastn="3">
<h2><$mt:EntryTitle$></h2>
</mt:Entries>
<ul>
<mt:Entries offset="3">
    <li><$mt:EntryTitle$></li>
</mt:Entries>
<ul>

recently_commented_on

Display the N most recently commented-on entries. Each entry will appear in the list only once. N is a positive integer.

<mt:Entries recently_commented_on="10">

Entries are in descending order by comment date.

sort_by

Defines the data to sort entries. The default value is “authored_on”. Accepted values are:

Use the limit attribute when sorting as lastn assumes that recent entries are desired.

scored_by

Allows filtering of entries that were scored by a particular user, specified by username. Requires the namespace attribute.

sort_order

Accepted values are “ascend” and “descend”. Default order is the order specified for “Entry Order” in the Entry Settings. Use the limit attribute when sorting as lastn assumes that recent entries are desired.

<mt:Entries sort_order="descend">

tag

Filters entries by specified tag; published and private tags are supported values. The Boolean operators (AND, OR, NOT, parenthetical grouping) described for category selection are also supported for the tag attribute.

Output all entries tagged with “cats”:

<mt:Entries tag="cats">

Output the opposite (all entries that are not tagged “cats”):

<mt:Entries tag="NOT cats">

Output all entries tagged “cats” and tagged “dogs”:

<mt:Entries tag="cats AND dogs">

Output all entries tagged “cats” but not tagged “dogs”::

<mt:Entries tag="cats AND NOT dogs">

tags

Alias of tag attribute.

unique

Filters out entries that have been previously published on the same page using another <mt:entries> tag. Values 1 or 0 (default).

The second Entries tag will exclude any entries that are output from the first Entries tag:

<mt:Entries tag="@featured" lastn="3">
    <$mt:EntryTitle$>
</mt:Entries>
<mt:Entries lastn="7" unique="1">
    <$mt:EntryTitle$>
</mt:Entries>

Combination of Attributes and Modifiers

Attributes can be combined to display entries such as the most recent entry in the “Important” category:

<mt:Entries lastn="1" category="Important">

Repeated modifiers are all processed:

<mt:Entries regex_replace="regex1" regex_replace="regex2">

Order of attributes and modifiers is important.

Trim to ten characters and then limit to the last 10 words:

<mt:Entries trim_to="10" words="10">

Limit to the last 10 words and then trim to 10 characters:

<mt:Entries words="10" trim_to="10">

Examples

Most Recent Entries

This code is typically use in an index template:

<ul>
<mt:Entries lastn="10">
    <li><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li>
<mt:Entries>
</ul>

Recently Modified Entries

The 25 most recently modified entries (most recent on top) in an index template:

<ul>
<mt:Entries sort_by="modified_on" sort_order="descend" limit="25">
    <li><$mt:EntryModifiedDate format="%Y-%m-%d"$> - <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li>
</mt:Entries>
</ul>

Complex Example

In the default templates for MT4, there are some tricky conditional items used within <mt:Entries>. A simplified version of the default loop looks like this:

<MTEntries>
<$MTEntryTrackbackData$>
<div id="entry-<$MTEntryID$>">
    <h2 class="asset-name"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h2>
    By <$MTEntryAuthorLink show_email="0"$> on <$MTEntryDate format="%x %X"$> |
    <a class="permalink" href="<$MTEntryPermalink$>">Permalink</a> | 
    <a href="<$MTEntryPermalink$>#comments">Comments (<$MTEntryCommentCount$>)</a> |
    <a href="<$MTEntryPermalink$>#trackback">TrackBacks (<$MTEntryTrackbackCount$>)</a>
    <$MTEntryBody$>
    <div class="entry-tags">
        <h4>Tags:</h4>
        <ul class="entry-tags-list">
            <li class="entry-tag">
            <MTEntryTags glue=",</li> <li>">
                <a href="<$MTTagSearchLink$>&IncludeBlogs=<$MTBlogID$>" rel="tag"><$MTTagName$></a>
            </MTEntryTags>
            </li>
        </ul>
    </div>
    Continue reading <a href="<$MTEntryPermalink$>#more"><$MTEntryTitle$></a>.
</div>
</MTEntries>

Related Entries by Category

Display entries which are in the same category as the current entry:

<$MTEntryCategory setvar="entry_category"$>
<MTEntries category="$entry_category" glue=", ">
    <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
</MTEntries>

Related Entries by Tag

Display entries which have the same tags as the current entry:

<mt:EntryIfTagged>
    <$mt:EntryID setvar="entry_id"$>
    <mt:SetVarBlock name="entry_tags"><mt:EntryTags glue=" OR "><$mt:TagName$></mt:EntryTags></mt:SetVarBlock>
    <mt:SetVarBlock name="related_entries">
        <mt:Entries tags="$entry_tags">
            <mt:SetVarBlock name="related_entry_id"><$mt:EntryID$></mt:SetVarBlock>
            <mt:Unless name="related_entry_id" eq="$entry_id">
                <li><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li>
            </mt:Unless>
        </mt:Entries>
    </mt:SetVarBlock>
    <mt:If name="related_entries">
        <h2>Related Entries</h2>
        <ul>
            <$mt:Var name="related_entries"$>
        </ul>
    </mt:If>
</mt:EntryIfTagged>

Related

EntriesCount

Returns the count of a list of entries that are currently in context (ie: used in an archive template, or inside an Entries tag). If no entry list context exists, it will fallback to the list that would be selected for a generic Entries tag (respecting number of days or entries configured to publish on the blog’s main index template).

How is this tag different from the BlogEntryCount tag? The BlogEntryCount tag will only return a count of all published entries. The EntriesCount tag can also do that, but it can also display a subset. Examples below.

Attributes

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:EntriesCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:EntriesCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:EntriesCount none="No entries">

or

<mt:EntriesCount none="None">

Example

This returns

"1 entry" or "9 entries" or "No entry".

Compared to BlogEntryCount

By itself, these two tags return the same count:

<mt:EntriesCount>
<mt:BlogEntryCount>

However, within the Entry context, Entries count can return a subset value:

<mt:Entries category="News">
    <mt:EntriesCount>
</mt:Entries>

Note that only the Entry context can be used with EntriesCount to find subset values; other contexts (such as Author or Monthly) will not find subset values.

EntriesFooter

The contents of this container tag will be displayed when the last entry listed by a Entries tag is reached.

EntriesHeader

The contents of this container tag will be displayed when the first entry listed by a Entries tag is reached.

EntriesWithSubCategories

A specialized version of mt:Entries that is aware of subcategories. The difference between the two tags is the behavior of the category attribute.

<mt:EntriesWithSubCategories>
  <!-- do something -->
</mt:EntriesWithSubCategories>

Attributes

category

The value of this attribute is a category label. This will include any entries to that category and any of its subcategories.

Since it is possible for two categories to have the same label, you can specify one particular category by including its ancestors, separated by slashes.

For instance if you have a category “Flies” and within it a subcategory labeled “Fruit”, you can ask for that category with category=”Flies/Fruit”. This would distinguish it from a category labeled “Fruit” within another called “Food Groups”, for example, which could be identified using category=”Food Groups/Fruit”.

If any category in the ancestor chain has a slash in its label, the label must be quoted using square brackets: category=”Beverages/[Coffee/Tea]” identifies a category labeled Coffee/Tea within a category labeled Beverages.

mt:Entries attributes

You can also use any of the other attributes available to mt:Entries; and they should behave just as they do with the original tag.

Examples

Because this tag is essentially a pre-filtered version of mt:Entries, please see mt:Entries for more examples.

EntryAdditionalCategories

This loop tag iterates over all secondary categories for the entry in context. This tag be used in an entry context (entry archive or mt:Entries loop).

<mt:EntryAdditionalCategories>
    <!-- do something -->
</mt:EntryAdditionalCategories>

This tag is similar to the mt:EntryCategories loop tag, but filters out the entry’s primary category.

Return the entry’s primary category using mt:EntryCategory.

Attributes

glue

If specified, this string is placed in between each result from the loop.

Examples

List and link to an entry’s non-primary categories:

<ul>
<mt:EntryAdditionalCategories >
        <li>
             <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a>
        </li>
</mt:EntryAdditionalCategories>
</ul>

EntryAssets

A container tag which iterates over a list of assets for the current entry in context. Supports all the attributes provided by the Assets tag.

Examples

Basic use:

<mt:Entries>
    <h2><mt:EntryTitle></h2>

    <mt:EntryAssets>
    <p><mt:AssetLabel></p>
    </mt:EntryAssets>
</mt:Entries>

Display only one image asset associated with each entry, making use of some of the attributes found in the Assets block tag:

<mt:Entries>
    <h2><mt:EntryTitle></h2>

    <mt:EntryAssets type="image" lastn="1">
    <img src="<mt:AssetThumbnailURL width="100">" alt="<mt:AssetLabel>" />
    </mt:EntryAssets>
</mt:Entries>

EntryAtomID

Outputs the unique Atom ID for the current entry in context.

EntryAudio

This template tag outputs a link to the audio portion of an Audio post.

This template tag is related to the custom fields that are automatically generated when you use Motion template sets. It can only be used with blogs created with Motion template sets.



Example:
<mt:Entries>
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
<$mt:EntryPostType setvar="post_type"$>
<li>
<mt:If name="entry_type" eq="photo">
<$mt:EntryPhoto$>
</mt:If>
<mt:If name="entry_type" eq="link">
<$mt:EntryLinkURL$>
</mt:If>
<mt:If name="entry_type" eq="embed">
<$mt:EntryEmbedCode$>
</mt:If>
<mt:If name="entry_type" eq="audio">
<$mt:EntryAudio$>
</mt:If>
</li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>

</mt:Entries>

EntryAuthor

Deprecated:This tag is considered deprecated in favor of EntryAuthorDisplayName. It is not recommended to publish MT usernames.

Outputs the display name of the author for the current entry in context.

EntryAuthorDisplayName

Outputs the display name of the author for the current entry in context.

<$mt:EntryAuthorDisplayName$>

If the author has not provided a display name for publishing, this tag will output an empty string.

EntryAuthorEmail

Outputs the email address of the author for the current entry in context. NOTE: it is not recommended to publish e-mail addresses for MT users.

Attributes:

EntryAuthorID

Outputs the numeric ID of the author for the current entry in context.

EntryAuthorLink

Outputs a linked author name suitable for publishing in the 'byline' of an entry.

Attributes:

EntryAuthorNickname

An alias of EntryAuthorDisplayName. This tag is deprecated in favor of EntryAuthorDisplayName.

EntryAuthorURL

Outputs the Website URL field from the author's profile for the current entry in context.

EntryAuthorUsername

Outputs the username of the author for the entry currently in context. NOTE: it is not recommended to publish MT usernames.

EntryAuthorUserpic

Outputs the HTML for the userpic of the author for the current entry in context.

EntryAuthorUserpicAsset

A block tag providing an asset context for the userpic of the author for the current entry in context. See the Assets tag for more information about publishing assets.

EntryAuthorUserpicURL

Outputs the URL for the userpic image of the author for the current entry in context.

EntryBasename

Outputs the basename field for the current entry in context.

Attributes:

EntryBlogDescription

Returns the blog description of the blog to which the entry in context belongs. The blog description is set in the General Blog Settings.

Example:

    <$mt:EntryBlogDescription$>

EntryBlogID

The numeric system ID of the blog that is parent to the entry currently in context.

Example:

    <$mt:EntryBlogID$>

EntryBlogName

Returns the blog name of the blog to which the entry in context belongs. The blog name is set in the General Blog Settings.

Example:

    <$mt:EntryBlogName$>

EntryBlogURL

Returns the blog URL for the blog to which the entry in context belongs.

Example:

    <$mt:EntryBlogURL$>

EntryBody

Outputs the “main” text of the current entry in context.

Modifiers

EntryBody supports many additional modifiers to help format the output of the tag. Using those attributes, you can transform the content so it shows up correctly in HTML, JavaScript, PHP, XML or other forms of output, use regular expressions to modify the output of this tag, change the case of characters, add or remove white space or even more with just a simple attribute on the mt:EntryBody tag.

If you’re using the Extended Entry field in Movable Type, it works similarly to EntryBody but uses the EntryMore tag.

EntryCategories

A container tag that lists all of the categories (primary and secondary) to which the entry is assigned. If multiple categories (primary and subcategory) are assigned to an Entry, the EntryCategories tag will return them in the order they were added (that is, not alphabetically, and not by hierarchy).

This tagset creates a category context within which any category or subcategory tags may be used.

<mt:Entries>
    <mt:EntryCategories>
        <!-- do something -->
    </mt:EntryCategories>
</mt:Entries>

Attributes

Examples

List and link all entry categories:

Note that this example does not necessarily return a correct hierarchical listing of the entry’s categories and is therefore not useful for generating breadcrumbs. (How to create breadcrumbs.)

<mt:Entries>
    <mt:EntryCategories glue=", ">
        <a href="<mt:ArchiveLink type="Category">">
            <mt:CategoryLabel></a>
    </mt:EntryCategories>
</mt:Entries>

If entry primary category label matches the label of the category in the loop, then make it bold:

<mt:Entries>
    <mt:EntryCategory setvar="entry_category">
    <ul>
    <mt:EntryCategories>
        <li><a href="<mt:ArchiveLink type="Category">"><mt:If tag="CategoryLabel" eq="$entry_category"><strong><mt:CategoryLabel></strong><mt:Else><mt:CategoryLabel></mt:If></a></li>
    </mt:EntryCategories>
    </ul>
    <mt:Var name="entry_category" value="">
</mt:Entries>

If entry category is in the set (Explore, Savor, Inside, Offbeat, Celebrate), add the category basename as a class and link to category archive.

<mt:Entries>
    <mt:EntryCategories>
        <mt:If tag="CategoryLabel"
            like="(Explore|Savor|Inside|Offbeat|Celebrate)">
            <mt:SetVarBlock name="category_basename"><mt:CategoryBasename></mt:SetVarBlock>
        </mt:If>
    </mt:EntryCategories>
    <div class="post <mt:Var name="category_basename">">
        <mt:EntryCategories>
            <mt:If tag="CategoryLabel" like="(Explore|Savor|Inside|Offbeat|Celebrate)">
            <a href="<mt:ArchiveLink type="Category">"><mt:CategoryLabel></a>
            </mt:If>
        </mt:EntryCategories>
        <!-- more entry data here -->
    </div>
    <mt:SetVar name="category_basename" value="">
</mt:Entries>

EntryCategory

This tag outputs the label of the main category for the entry.

<$mt:EntryCategory$>

Must be used in an entry context (entry archive or mt:Entries loop).

All entry categories can be listed using mt:EntryCategories loop tag.

Examples

Create a link to the Category archive of the entry’s main category (when in entry context):

<a href="<$mt:EntryLink type="Category"$>"><$mt:EntryCategory$></a>

Tip: Due to legacy taging the mt:EntryCategory function tag will output the same value as the mt:FolderLabel function tag when used in the context of a page. Unlike the mt:PageFolder tag which is block tag and must be used with the mt:FolderLabel tag.

Use this mtml

 <mt:If tag="EntryCategory" eq="Appendix: Configuration Directives">
   This main folder for this page is "Appendix: Configuration Directives".
   Confirmation using `mt:EntryCategory`: "<$mt:EntryCategory$>".
 </mt:If>

EntryClass

Pages and entries are technically very similar to one another. In fact most, if not all, of the <mt:Entry*> tags will work for publishing pages and vice versa. Therefore, to more clearly differentiate within templates between pages and entries the <mt:EntryClass> tag returns one of two values: "page" or "entry" depending upon the current context you are in.

Example:

    <mt:If tag="EntryClass" eq="page">
        (we're publishing a page)
    <mt:Else>
        (we're publishing something else -- probably an entry)
    </mt:If>

EntryClassLabel

Returns the localized name of the type of entry being published. For English blogs, this is the word "Page" or "Entry".

Example:

    <$mt:EntryClassLabel$>

EntryCommentCount

Outputs the number of published comments for the current entry in context.

Attributes

All <mt:EntryCommentCount> attributes are optional. The most common attributes are:

singular

Allows special formatting for when the number of published comments for the entry is equal to 1.

<$mt:EntryCommentCount singular="1 comment">

plural

Allows special formatting for when the number of published comments for the entry is greater than 1. # is automatically replaced with the number of objects.

<$mt:EntryCommentCount plural="# comments">

none

Allows special formatting for when the number of published comments for the entry is 0 (zero).

<$mt:EntryCommentCount none="No comments">

or

<$mt:EntryCommentCount none="None">

top

if specified, gets a count of comments that do not contain a reply.

Example

<$mt:EntryCommentCount singular="1 comment" plural="# comments" none="no comments"$>

EntryCreatedDate

Outputs the creation date of the current entry in context. See the Date tag for supported attributes.

EntryCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

EntryCustomFieldName

Displays the name or "label" for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

EntryCustomFields

This container tag iterates, or loops, over all custom fields associated with an entry.

<mt:Entries>
    <mt:EntryCustomFields>
        <$mt:CustomFieldName$>
    </mt:EntryCustomFields>
</mt:Entries>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:EntryCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:EntryCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:EntryCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:EntryCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

EntryCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

EntryDate

Outputs the 'authored' date of the current entry in context. See the Date tag for supported attributes.

EntryEditLink

This template tag was obsoleted. You can display "Edit Link" by the following code. It is recommended to check viewer's session cookie to detects whether or not a user is signed in before showing the edit link.

<a href="<$mt:cgipath$><$mt:adminscript$>?__mode=view&_type=entry&id=<$mt:entryid$>&blog_id=<$mt:entryblogid$>">edit</a>

A link to edit the entry in context from the Movable Type CMS. This tag is only recognized in system templates where an authenticated user is logged-in.

Attributes:

Example:

    <$mt:EntryEditLink$>

EntryEmbedCode

This template tag outputs the embedded (embed) parameters for a Embedded Object (Video) post.

This template tag is related to the custom fields that are automatically generated when you use Motion template sets. It can only be used with blogs created with Motion template sets.



Example:
<mt:Entries>
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
<$mt:EntryPostType setvar="post_type"$>
<li>
<mt:If name="entry_type" eq="photo">
<$mt:EntryPhoto$>
</mt:If>
<mt:If name="entry_type" eq="link">
<$mt:EntryLinkURL$>
</mt:If>
<mt:If name="entry_type" eq="embed">
<$mt:EntryEmbedCode$>
</mt:If>
<mt:If name="entry_type" eq="audio">
<$mt:EntryAudio$>
</mt:If>
</li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>
</mt:Entries>

EntryExcerpt

This tag outputs the contents of the Entry Excerpt field if one is specified or, if not, an auto-generated excerpt from the Entry Body field followed by an ellipsis (“…”). If an excerpt is auto-generated also note that any HTML is stripped.

The length of the auto-generated output of this tag can be set in the blog’s Entry Settings.

Attributes

Example

 <mt:EntryExcerpt words="100" convert_breaks="1">

Below is a more complex example. This example grabs the EntryExcerpt, but only if one has been manually created in the Excerpt field, then saves it to the excerpt variable. That excerpt variable is then tested

<mt:EntryExcerpt no_generate="1" setvar="excerpt">
<mt:If name="excerpt">
    <mt:EntryExcerpt>
<mt:Else>
    <mt:EntryBody>
</mt:If>

EntryFlag

Used to output any of the status fields for the current entry in context.

Attributes:

EntryID

Ouptuts the numeric ID for the current entry in context.

Behind the scenes in the database, the mt_entry table has a column called entry_id. The entry_id column is a unique number that is auto-incremented. This unique auto-incremented number is the ID returned by this tag.

Attributes

EntryIfAllowComments

Conditional tag that is positive when the entry in context is configured to allow commenting and the blog and MT installation also permits comments.

EntryIfAllowPings

Deprecated in favor of IfPingsAccepted.

EntryIfCategory

Deprecated: This tag has been deprecated in favor of mt:IfCategory.

Returns true if the current page or entry belongs to the designated category.

Attributes

An attribute of label is required.

label

Label of the Category being conditioned.

name

Alias of label

Example

<mt:EntryIfCategory label="News">
  <!- do something ->
<mt:else>
  <!- do something else ->
</mt:EntryIfCategory>

EntryIfCommentsOpen

Deprecated in favor of EntryIfCommentsActive.

EntryIfExtended

Conditional tag that is positive when content is in the extended text field of the current entry in context.

Example

<mt:Entries>
    <h2><mt:EntryTitle></h2>
    <mt:EntryBody>

    <mt:EntryIfExtended>
        <a href="<mt:EntryPermalink>">Read more...</a>
    </mt:EntryIfExtended>
</mt:Entries>

Note that the EntryIfExtended conditional tag set also works with Pages, within a <mt:Pages> context.

EntryIfTagged

This template tag evaluates a block of code if a tag has been assigned to the current entry in context.

If the tag attribute is not assigned, then the template tag will evaluate if any tag is present.

Check for a specific tag…

<mt:EntryIfTagged tag="Foo">
    This entry has the tag "Foo"
</mt:EntryIfTagged>

Check if any tags are assigned to the entry…

<mt:EntryIfTagged>
    This entry has tags
</mt:EntryIfTagged>

Context

Attributes

tag

If present, the template tag will evaluate if the specified tag is assigned to the current entry.

include_private=”0”

Include private tag if “1” is set.

Example

Conditional if tagged “Foo” or not:

<mt:EntryIfTagged tag="Foo">
    <!-- do something -->
<mt:Else>
    <!-- do something else -->
</mt:EntryIfTagged>

Condition based upon if a entry is tagged with the private tag @draft:

<mt:Entries>
    <li class="entry <mt:EntryIfTagged tag="@draft">draft</mt:EntryIfTagged>">
        <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
        <mt:EntryIfTagged tag="@draft">(draft)</mt:EntryIfTagged>
    </li>
</mt:Entries>

Bugs

Related

EntryKeywords

Outputs the value of the keywords field for the current entry in context.

Example:


<meta name="Keywords" content="<$mt:EntryKeywords _default="default keywords go here"$>" />

EntryLink

Outputs absolute URL pointing to an archive page related to the the current entry in context.

When used without the archive_type attribute, a link to the entry permalink (individual) will be output… same as if the <$mt:EntryPermalink$> was used.

Link to the main category archive of the entry in context:

<a href="<$mt:EntryLink type="Category"$>"><$mt:EntryCategory$></a>

If the same archive mapping type is used more than once in the same blog, a url to the preferred archive will be output.

Note: The preferred archive can be selected by selecting the checkbox next to the archive mapping type in the Template Options for the template you wish to be the preferred template.

Attributes

archive_type

Identifies the archive type to use when creating the link.

Valid archive types are case sensitive:

type

Alias of archive_type.

Examples

Link to the main category archive of the entry in context:

<a href="<$mt:EntryLink type="Category"$>"><$mt:EntryCategory$></a>

Link to the appropriate Monthly archive for the current entry (assuming Monthly archives are published), you can use this:

<a href="<$mt:EntryLink type="Monthly"$>"><$mt:EntryDate format="%B %Y"$> Archives</a>

Link to other entries by the current author (assuming Author archives are published):

<a href="<$mt:EntryLink type="Author"$>"><$mt:EntryAuthorDisplayName$></a>

Related Tags

EntryLinkURL

This template tag outputs the URL object of a URL post. This is different than the <MTEntryPermalink>, which outputs the URL of the post itself.

This template tag is related to the custom fields that are automatically generated when you use Motion template sets. It can only be used with blogs created with Motion template sets.



Example:
<mt:Entries>
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
<$mt:EntryPostType setvar="post_type"$>
<li>
<mt:If name="entry_type" eq="photo">
<$mt:EntryPhoto$>
</mt:If>
<mt:If name="entry_type" eq="link">
<$mt:EntryLinkURL$>
</mt:If>
<mt:If name="entry_type" eq="embed">
<$mt:EntryEmbedCode$>
</mt:If>
<mt:If name="entry_type" eq="audio">
<$mt:EntryAudio$>
</mt:If>
</li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>

</mt:Entries>



EntryModifiedDate

Outputs the modification date of the current entry in context. See the Date tag for supported attributes.

EntryMore

Outputs the “extended” text of the current entry in context. Refer to the EntryBody tag for supported attributes.

EntryNext

A container tag providing a context for the entry immediately following the current entry (in terms of authored date).

Modifiers

Bug: In Movable Type 4.x there is a bug where if entries have the exact same date-time then the mt:EntryPrevious and mt:EntryNext container tags may skip an entry. This has been fixed in Movable Type 5.

Example

<mt:Entries>
    <mt:EntryTitle>
    <mt:EntryNext>
        The next entry is:
        <a href="<mt:EntryPermalink>"><mt:EntryTitle></a>
    </mt:EntryNext>
</mt:Entries>

Related

EntryPermalink

An absolute URL pointing to the archive page containing this entry. An anchor (#) is included if the permalink is not pointing to an Individual Archive page.

Most of the time, you'll want to use this inside a hyperlink. So, inside any Entries loop, you can make a link to an entry like this:

    <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>

Attributes:


EntryPermalink supports a whole bunch of additional attributes to help format the output of the tag. Using those attributes, you can escape the content so it shows up correctly in HTML, JavaScript, PHP, XML or other forms of output.

In the past, mt:EntryPermalink has been known as MTEntryPermalink, too. If you want to link to an Entry in one of the other archives it appears in, the mt:EntryLink tag will let you link to that entry as part of a Monthly archive, a Category archive, an Author archive or many other contexts.

EntryPhoto

This template tag outputs the image (img) parameters for a Photo post.

This template tag is related to the custom fields that are automatically generated when you use Motion template sets. It can only be used with blogs created with Motion template sets.



Example:
<mt:Entries>
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
<$mt:EntryPostType setvar="post_type"$>
<li>
<mt:If name="entry_type" eq="photo">
<$mt:EntryPhoto$>
</mt:If>
<mt:If name="entry_type" eq="link">
<$mt:EntryLinkURL$>
</mt:If>
<mt:If name="entry_type" eq="embed">
<$mt:EntryEmbedCode$>
</mt:If>
<mt:If name="entry_type" eq="audio">
<$mt:EntryAudio$>
</mt:If>
</li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>
</mt:Entries>

EntryPostType

In the no longer supported Motion template set, entries have types such as “Photo”, “Video”, “Link”, “Embed” and “Audio”. This tag returns the specific type for the entry in context.

EntryPrevious

A container tag providing a context for the entry immediately preceding the current entry (in terms of authored date).

Modifiers

Bug: In Movable Type 4.x there is a bug where if entries have the exact same date-time then the mt:EntryPrevious and mt:EntryNext container tags may skip an entry. This has been fixed in Movable Type 5.

Example

<mt:Entries>
    <mt:EntryTitle>
    <mt:EntryPrevious>
        The previous entry is:
        <a href="<mt:EntryPermalink>"><mt:EntryTitle></a>
    </mt:EntryPrevious>
</mt:Entries>

Related

EntryPrimaryCategory

A container tag that lists the primary category to which the entry is assigned.

Examples

<mt:Entries>
  <mt:EntryPrimaryCategory><$mt:CategoryLabel$></mt:EntryPrimaryCategory>
  or
  <mt:EntryCategories type="primary"><$mt:CategoryLabel$></mt:EntryCategories>

</mt:Entries>

EntryRank

A function tag which returns a number from 1 to 6 (by default) which represents the rating of the entry in context in terms of total score where '1' is used for the highest score, '6' for the lowest score.

Attributes:

Example:

    <$mt:EntryRank namespace="FiveStarRating"$>

EntryRawPostType

This template tag outputs an entry's post type. Post types include:

This template tag is related to the custom fields that are automatically generated when you use Motion template sets. It can only be used with blogs created with Motion template sets.



Example:
<mt:Entries lastn="5">
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
<li class="post type-<$mt:EntryPostType$>"><$mt:EntryTitle$></li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>
</mt:Entires>

When the Motion Template Set is used, you can submit posts that contain more than simple text.


EntryScore

A function tag that provides total score of the entry in context. Scores grouped by namespace of a plugin are summed to calculate total score of an entry.

Attributes:

Example:

    <$mt:EntryScore namespace="FiveStarRating"$>

EntryScoreAvg

A function tag that provides the avarage score of the entry in context. Scores grouped by namespace of a plugin are summed to calculate total score of an entry, and average is calculated by dividing the total score by the number of scorings or 'votes'.

Attributes:

Example:

    <$mt:EntryScoreAvg namespace="FiveStarRating"$>

EntryScoreCount

A function tag that provides the number of scorings or 'votes' made to the entry in context. Scorings grouped by namespace of a plugin are summed.

Attributes:

Example:

    <$mt:EntryScoreCount namespace="FiveStarRating"$>

EntryScoreHigh

A function tag that provides the highest score of the entry in context. Scorings grouped by namespace of a plugin are sorted to find the highest score of an entry.

Attributes:

Example:

    <$mt:EntryScoreHigh namespace="FiveStarRating"$>

EntryScoreLow

A function tag that provides the lowest score of the entry in context. Scorings grouped by namespace of a plugin are sorted to find the lowest score of an entry.

Attributes:

Example:

    <$mt:EntryScoreLow namespace="FiveStarRating"$>

EntryStatus

Intended for application template use only. Displays the status of the entry in context. This will output one of “Draft”, “Publish”, “Review” or “Future”.

In Movable Type 6.0 or later, “Unpublish” can be output when the entry has passed it’s scheduled unpublishing date.

Usage

<$mt:EntryStatus$>

EntryTags

A container tag used to output information about the entry tags assigned to the Entry in context.

Note that this template tag will not retrieve any private entry tags assigned to the Entry (tags starting with “@”).

Attributes

Example

The following code can be used anywhere Entries can be used. It prints a list of all of the tags assigned to each entry returned by Entries glued together by a comma and a space.

To avoid printing out the leading text when no entry tags are assigned you can use the EntryIfTagged conditional block to first test for entry tags on the entry. You can also use the EntryIfTagged conditional block with the tag attribute to test for the assignment of a particular entry tag.

<mt:EntryIfTagged>
    The entry "<mt:EntryTitle>" is tagged:
    <mt:EntryTags glue=", "><mt:TagName></mt:EntryTags>
</mt:EntryIfTagged>

EntryTitle

Outputs the title of the current entry in context.

Attributes:


EntryTitle supports a whole bunch of attributes to help format the output of the tag. Using those attributes, you can escape the content so it shows up correctly in HTML, JavaScript, PHP, XML or other forms of output.

In the past, mt:EntryTitle has been known as MTEntryTitle, too.

EntryTrackbackCount

Outputs the number of published TrackBack pings for the current entry in context.

EntryTrackbackData

Outputs the TrackBack RDF block that allows for TrackBack autodiscovery to take place. If TrackBack is not enabled for the entry, this will output an empty string.

Attributes:

EntryTrackbackID

Outputs the numeric ID of the TrackBack for the current entry in context. If not TrackBack is not enabled for the entry, this outputs an empty string.

EntryTrackbackLink

Outputs the TrackBack endpoint for the current entry in context. If TrackBack is not enabled for the entry, this will output an empty string.

ErrorMessage

This tag is used by the system to display the text of any user error message. Used in system templates, such as the 'Comment Response' template.

F

Feed

Type: block

Example

 <mt:Feed uri="http://www.movabletype.org/atom.xml">
  <h2><$mt:FeedTitle$></h2>
    <ul>
    <mt:FeedEntries>
       <li><a href="<$mt:FeedEntryLink encode_html="1"$>"><$mt:FeedEntryTitle$></a></li>
    </mt:FeedEntries>
   </ul>
</mt:Feed>

FeedbackScore

Outputs the numeric junk score calculated for the current comment or TrackBack ping in context. Outputs '0' if no score is present. A negative number indicates spam.

FeedEntries

This is a block tag to fetch entries from the specified feed.

Example

<mt:Feed uri="http://www.movabletype.org/index.xml">
  <h2><$mt:FeedTitle$></h2>
  <ul> 
  <mt:FeedEntries>
    <li><a href="<$mt:FeedEntryLink encode_html="1"$>"><$mt:FeedEntryTitle$></a></li>
  </mt:FeedEntries>
  </ul>
</mt:Feed><mt:FeedEntries>

FeedEntryLink

Type: function

Example

<mt:FeedEntryLink />

FeedEntryTitle

Type: function

Example

<mt:FeedEntryTitle />

FeedInclude

Type: function

Example

<mt:FeedInclude />

FeedLink

Type: function

Example

<mt:FeedLink />

FeedTitle

Type: function

Example

<mt:FeedTitle />

FileCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

FileCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

FileCustomFields

This container tag iterates, or loops, over all custom fields associated with a file type asset.

See mt:EntryCustomFields for more details.

<mt:FileCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:FileCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:FileCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:FileCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:FileCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:FileCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

FileCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

FileTemplate

Produces a file name and path using the archive file naming specifiers.

Attributes:

Example:

    <$mt:FileTemplate format="%y/%m/%f"$>

FolderBasename

Produces the dirified basename defined for the folder in context.

Attributes:

Example:

    <$mt:FolderBasename$>

FolderCount

The number published pages in the folder.

Example:

    <$mt:FolderCount$>

FolderCustomFieldDescription

Deprecated: Same as mt:CustomFieldDescription. See EntryCustomFields for more info.

This will display the description of the current custom field in context.

FolderCustomFieldName

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

FolderCustomFields

This container tag iterates, or loops, over all custom fields associated with a folder.

See mt:EntryCustomFields for more details.

<mt:Folders>
    <mt:FolderCustomFields>
        <$mt:CustomFieldName$>
    </mt:FolderCustomFields>
</mt:Folders>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:FolderCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:FolderCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:FolderCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:FolderCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

FolderCustomFieldValue

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

FolderDescription

The description for the folder in context.

Example:

    <$mt:FolderDescription$>

FolderFooter

The contents of this container tag will be displayed when the last folder listed by a Folders tag is reached.

FolderHeader

The contents of this container tag will be displayed when the first folder listed by a Folders tag is reached.

FolderID

The numeric system ID of the folder.

Example:

    <$mt:FolderID$>

FolderLabel

The label of the folder in context.

Examples

In a Page archive template, list the folder label which the page is in:

<mt:PageFolder>
    <$mt:FolderLabel$>
</mt:PageFolder>

Note: Because folders don’t have archive templates, there is no <$mt:FolderArchiveLink$> because there is no guarantee that a page with the basename of index exists in the folder. Thus linking to the folder must be created manually using “<$mt:BlogURL$><$mt:FolderPath$>/”.

In order to create a link to the folder’s URL the href must be constructed using mt:BlogURL and mt:FolderPath:

<mt:PageFolder>
    <a href="<$mt:BlogURL$><$mt:FolderPath$>/"><$mt:FolderLabel$></a>
</mt:PageFolder>

FolderNext

A container tag which creates a folder context of the next folder relative to the current page folder or archived folder.

FolderPath

The path to the folder, relative to the BlogURL.

Attributes

Example

For the folder “Bar” in a folder “Foo” <mt:FolderPath> becomes foo/bar.

FolderPrevious

A container tag which creates a folder context of the previous folder relative to the current page folder or archived folder.

Folders

A container tag which iterates over a list of all Folders and Subfolders. This block tag is the counterpart to the Categories tag (which iterates over a list of all Categories and Subcategories); as such the same attributes are available.

Attributes

Examples

There is no <mt:FolderArchiveLink> tag, thus the workaround is this: <mt:BlogURL><mt:FolderPath>/. Let’s use that in an example showing the Folders tag, below:

<mt:Folders glue=", ">
    <a href="<mt:BlogURL><mt:FolderPath>/">
        <mt:FolderLabel>
    </a>
</mt:Folders>

For

Many programming languages support the notion of a "for" loop. In the most simple use case one could give, a for loop is a way to repeatedly execute a piece of code n times.

Technically a for loop advances through a sequence (e.g. all odd numbers, all even numbers, every nth number, etc), giving the programmer greater control over the seed value (or "index") of each iteration through the loop.

Attributes:

Within the tag, the following variables are assigned:

Example:

    <mt:For from="2" to="10" step="2" glue=","><$mt:Var name="__index__"$></mt:For>

Produces:

    2,4,6,8,10

G

GetVar

An alias for the 'Var' tag, and considered deprecated in favor of 'Var'.

GreetFacebookCommenters

This tag outputs no data and is still provided only for backward compatibility.

H

HasNoParentCategory

Returns true if the current category does not have a parent category.

<mt:Categories>
    <mt:HasNoParentCategory>
        <$mt:CategoryLabel$> has no parent category.
    </mt:HasNoParentCategory>
</mt:Categories>

This type of conditioning can be done with the mt:IfCategory tag as well.

Example

List categories and note if each has a parent or not:

<ul>
<mt:Categories>
    <li>
    <mt:HasNoParentCategory>
        <$mt:CategoryLabel$> has no parent category.
    <mt:Else>
        <$mt:CategoryLabel$> has a parent category.
    </mt:HasNoParentCategory>
    </li>
</mt:Categories>
</ul>

Related

HasNoParentFolder

This conditional tag detects when the current folder has no parent folder, meaning it is a top level folder.

HasNoSubCategories

Returns true if the current category has no sub-categories.

HasNoSubfolders

This conditional tag detects when the current folder has no subfolders.

HasParentCategory

Returns true if the current category has a parent category.

<mt:Categories>
    <mt:HasParentCategory>
        <$mt:CategoryLabel$> has a parent category.
    </mt:HasParentCategory>
</mt:Categories>

This type of conditioning can be done with the mt:IfCategory tag as well.

Example

List categories noting if each has a parent or not. If has a parent, list the parent category:

<ul>
<mt:Categories>
    <li>
    <mt:HasParentCategory>
        <$mt:CategoryLabel$> has a parent category.
        <mt:ParentCategory>
            (Parent Category: <a href="<mt:ArchiveLink>"><mt:CategoryLabel></a>)
        </mt:ParentCategory>
    <mt:Else>
        <$mt:CategoryLabel$> has no parent category.
    </mt:HasParentCategory>
    </li>
</mt:Categories>
</ul>

Related

HasParentFolder

Returns true if the current folder has a parent folder other than the root.

HasSubCategories

Within a category context, this tag returns true if the current category has a sub-category.

Example

<mt:IfArchiveType type="Category">
    <mt:CategoryLabel>

    <mt:HasSubCategories>
        Subcategories:
        <mt:SubCategories glue=", ">
            <mt:CategoryLabel>
        </mt:SubCategories>
    </mt:HasSubCategories>
</mt:IfArchiveType>

HasSubFolders

Returns true if the current folder has a sub-folder.

HTTPContentType

When this tag is used in a dynamically published index template, the value specified to the type attribute will be returned in the Content-Type HTTP header sent to web browser. This content is never displayed directly to the user but is instead used to signal to the browser the data type of the response.

When this tag is used in a system template, such as the search results template, mt-search.cgi will use the value specified to "type" attribute and returns it in Content-Type HTTP header to web browser.

When this tag is used in statically published template, this template tag outputs nothing.

Attributes:

Example:

    <$mt:HTTPContentType type="application/xml"$>

I

If

A conditional block that is evaluated if the attributes/modifiers evaluate true. This tag can be used in combination with the ElseIf and Else tags to test for a variety of cases.

The opposite — that is, to evaluate if false — is <mt:Unless>.

Attributes

* + or add: addition * - or sub: subtraction * ++ or inc: adds 1 to the given value * -- or dec: subtracts 1 from the given value * * or mul: multiplication * / or div: division ** % or mod: issues a modulus operator

Examples

If variable “foo” has a non-zero value:

    <mt:SetVar name="foo" value="bar">
    <mt:If name="foo">
        <!-- do something -->
    </mt:If>

If variable “foo” has a value equal to “bar”:

    <mt:SetVar name="foo" value="bar">
    <mt:If name="foo" eq="bar">
        <!-- do something -->
    </mt:If>

If variable “foo” has a value that starts with “bar” or “baz”:

    <mt:SetVar name="foo" value="barcamp" />
    <mt:If name="foo" like="^(bar|baz)">
        <!-- do something -->
    </mt:If>

If tag <$mt:EntryTitle$> has a value of “hello world”:

    <mt:If tag="EntryTitle" eq="hello world">
        <!-- do something -->
    </mt:If>

If tag <$mt:CategoryCount$> is greater than 10 add “(Popular)” after Category Label:

    <mt:Categories>
        <$mt:CategoryLabel$>
        <mt:If tag="CategoryCount" gt="10">(Popular)</mt:If>
    </mt:Categories>

If tag <$mt:EntryAuthor$> is “Melody” or “melody” and last name is “Nelson” or “nelson” then do something:

    <mt:Authors>
        <mt:If tag="EntryAuthor" like="/(M|m)elody (N|n)elson/"
            <!-- do something -->
        </mt:If>
    </mt:Authors>

If the <$mt:CommenterEmail$> matches foo@domain.com or bar@domain.com:

    <mt:If tag="CommenterEmail" like="(foo@domain.com|bar@domain.com)">
        <!-- do something -->
    </mt:If>

If the <$mt:CommenterUsername$> matches the username of someone on the Movable Type team:

    <mt:If tag="CommenterUsername" like="(beau|byrne|brad|jim|mark|fumiaki|yuji|djchall)">
        <!-- do something -->
    </mt:If>

If <$mt:EntryCategory$> is “Comic” then use the Comic template module otherwise use the default:

    <mt:If tag="EntryCategory" eq="Comic">
        <$mt:Include module="Comic Entry Detail"$>
    <mt:Else>
        <$mt:Include module="Entry Detail"$>
    </mt:If>

If <$mt:EntryCategory$> is “Comic”, “Sports”, or “News” then link to the category archive:

    <mt:If tag="EntryCategory" like="(Comic|Sports|News)">
        <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a>
    <mt:Else>
        <$mt:CategoryLabel$>
    </mt:If>

List all categories and link to categories it the category has one or more entries:

    <mt:Categories show_empty="1">
        <mt:If name="__first__">
    <ul>
        </mt:If>
        <mt:If tag="CategoryCount" gte="1">
        <li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
        <mt:Else>
        <li><$MTCategoryLabel$></li>
        </mt:If>
        <mt:If name="__last__">
    </ul>
        </mt:If>
    </mt:Categories>

Test a variable using Perl:

    <mt:If test="length($some_variable) > 10">
        '<$mt:Var name="some_variable"$>' is 11 characters or longer
    </mt:If>

Compare two variables:

<mt:Var name="my_var1" value="foo">
<mt:TagName setvar="my_var2">

<mt:If name="my_var1" eq="$my_var2">
    Foo is equal to bar.
<mt:else>
    Foo is not equal to bar.
</mt:If>

Related

IfAllowCommentHTML

Conditional block that is true when the blog has been configured to permit HTML in comments.

IfArchiveType

This tag allows you to conditionalize a section of template code based on whether the primary template being published is a specific type of archive template.

Attributes

Example

If you wanted to include autodiscovery code for a customized Atom feed for each individual entry (perhaps for tracking comments) you could put this in your Header module. This would serve up the first link for Individual archives and the normal feed for all other templates:

<mt:IfArchiveType type="individual">
    <link rel="alternate" type="application/atom+xml"
        title="Comments Feed"
        href="<mt:FileTemplate format="%y/%m/%-F.xml">" />
<mt:Else>
    <link rel="alternate" type="application/atom+xml"
        title="Recent Entries"
        href="<mt:Link template="feed_recent">" />
</mt:IfArchiveType>

IfArchiveTypeEnabled

A conditional tag used to test whether a specific archive type is published or not.

Attributes:

Example:

    <mt:IfArchiveTypeEnabled type="Category-Monthly">
        <!-- do something -->
    <mt:Else>
        <!-- do something else -->
    </mt:IfArchiveTypeEnabled>

IfAuthor

A conditional tag that is true when an author object is in context.

    <mt:IfAuthor>
        Author: <$mt:AuthorDisplayName$>
    </mt:IfAuthor>

IfBlog

A conditional tag that produces its contents when there is a blog in context. This tag is useful for situations where a blog may or may not be in context, such as the search template, when a search is conducted across all blogs.

Example:

    <mt:IfBlog>
        <h1>Search results for <$mt:BlogName$>:</h1>
    <mt:Else>
        <h1>Search results from all blogs:</h1>
    </mt:IfBlog>

IfCategory

A conditional tag for determining if the entry in context is assigned categories. Determine if in a specific category and/or if the category is a primary or secondary category.

While this tag can be used as a way to filter Entries, a much better approach is to use the category attribute of the Entries tag.

Attributes

Examples

Determine if the entry in context is assigned a category:

<mt:Entries>
    <mt:IfCategory>
        <!-- Entry is assigned a category -->
    <mt:Else>
        <!-- Entry is not assigned a category -->
    </mt:IfCategory>
</mt:Entries>

Determine if the Entry in context is assigned the category “News” and apply some special formatting; Entries in other categories are simply listed:

<ul>
<mt:Entries>
    <mt:IfCategory label="News">
    <li>News and Events:
        <strong><mt:EntryTitle></strong></li>
    <mt:Else>
    <li><mt:EntryTitle></li>
    </mt:IfCategory>
</mt:Entries>
</ul>

Determine if the entry in context is the in the primary category “News”:

<mt:Entries>
    <mt:IfCategory label="News" type="primary">
        <!-- entry in context is assigned the 
             primary category "News" -->
    </mt:IfCategory>
</mt:Entries>

If you have need to test for many categories it may make more sense to use the If tag with the like attribute instead of multiple uses of this tag. Example:

<mt:Entries>
    <mt:If tag="EntryCategory"
            like="/(News|Events|Reviews)/">
        <!-- Display the News, Events, 
             and Reviews Entries -->
    <mt:Else>
        <!-- Display all other Entries -->
    </mt:If>
</mt:Entries>

IfCommenterIsAuthor

Conditional tag that is true when the current comment was left by a user who is also a native MT user.

IfCommenterIsEntryAuthor

This template tag returns true if the current comment in context was authored or written by the same person who wrote the entry the comment is associated with. This allows designers to style comments from users and authors differently then the general public.

Example

In the Entry context:

<h2><mt:EntryTitle>, by <mt:EntryAuthorDisplayName></h2>
<mt:Comments>
<div class="comment
    <mt:IfCommenterIsEntryAuthor>comment-by-author</mt:IfCommenterIsEntryAuthor>">
    <p><mt:CommenterName>:</p>
    <mt:CommentBody>
</div>
</mt:Comments>

IfCommenterRegistrationAllowed

Conditional block to test if commenter registration is enabled.

IfCommenterTrusted

A conditional tag that displays its contents if the commenter in context has been marked as trusted.

IfCommentParent

A conditional tag that is true when the comment currently in context is a reply to another comment.

Example:

    <mt:IfCommentParent>
        (a reply)
    </mt:IfCommentParent>

IfCommentReplies

A conditional tag that is true when the comment currently in context has replies.

IfCommentsAccepted

Conditional tag that displays its contents if commenting is enabled for the entry in context.

Example:

    <mt:IfCommentsAccepted>
        <h3>What do you think?</h3>
        (comment form)
    </mt:IfCommentsAccepted>

IfCommentsActive

Conditional tag that displays its contents if comments are enabled or comments exist for the entry in context.

IfCommentsAllowed

Conditional block that is true when the blog is configured to accept comments, and comments are accepted on a system-wide basis. This tag does not take the current entry context into account; use the IfCommentsAccepted tag for this.

IfCommentsModerated

A conditional tag that is true when the blog is configured to moderate incoming comments from anonymous commenters.

IfCurrentPage

A conditional tag returns true if the current page in the context of PagerBlock is the current page that is being rendered. The tag must be used in the context of PagerBlock.

IfDynamic

Returns true if the current publishing context is dynamic publishing, and false otherwise.

IfExternalUserManagement

A conditional tag that returns true when external user management is turned on.

IfFolder

A conditional tag used to test for the folder assignment for the page in context, or generically to test for which folder is in context.

Attributes:

Example:

    <mt:IfFolder name="News">
        (current page in context is in the "News" folder)
    </mt:IfFolder>

IfImageSupport

A conditional tag that returns true when the Movable Type installation has the Perl modules necessary for manipulating image files.

IfIsAncestor

Conditional tag that is true when the category in context is an ancestor category of the specified “child” attribute.

Attributes

Example

    <mt:IfIsAncestor child="Featured">
        (category in context is a parent category
        to a subcategory named "Featured".)
    </mt:IfIsDescendant>

IfIsDescendant

Conditional tag that is true when the category in context is a child category of the specified “parent” attribute.

Attributes

Example

    <mt:IfIsDescendant parent="Featured">
        (category in context is a child category
        to the 'Featured' category.)
    </mt:IfIsDescendant>

IfMaxResultsCutoff

NOTE: this tag only applies if you are using older Movable Type than version 4.15, or you set up your search script so it instantiates MT::App::Search::Legacy, the older search script. Under the default search script in Movable Type, this tag will never be evaluated as true and therefore the contents will never be rendered.

A conditional tag that returns true when the number of search results per blog exceeds the maximium limit specified in MaxResults configuration directive.

This tag is only recognized in search templates.

IfMoreResults

A conditional tag used to test whether the requested content has more to show than currently appearing in the page.

IfNeedEmail

Conditional tag that is positive when the blog is configured to require an e-mail address for anonymous comments.

IfNonEmpty

A conditional tag used to test whether a template variable or tag are non-empty. This tag is considered deprecated, in favor of the <mt:If> tag.

Attributes

IfNonZero

A conditional tag used to test whether a template variable or tag are non-zero. This tag is considered deprecated, in favor of the If tag.

Attributes:

IfPingsAccepted

Conditional tag that is positive when pings are allowed for the blog and the entry (if one is in context) and the MT installation.

IfPingsActive

Conditional tag that displays its contents if TrackBack pings are enabled or pings exist for the entry in context.

IfPingsAllowed

Conditional tag that is positive when pings are allowed by the blog and the MT installation (does not test for an entry context).

IfPingsModerated

Conditional tag that is positive when the blog has a policy to moderate all incoming pings by default.

IfPreviousResults

A conditional tag used to test whether the requested content has previous page.

IfRegistrationAllowed

A conditional tag that is true when the blog has been configured to permit user registration.

Attributes:

IfRegistrationNotRequired

A conditional tag that is true when the blog has been configured to permit anonymous comments.

IfRegistrationRequired

A conditional tag that is true when the blog has been configured to require user registration.

IfRequireCommentEmails

Conditional tag that is positive when the blog is configured to require an e-mail address for anonymous comments.

IfStatic

Returns true if the current publishing context is static publishing, and false otherwise.

IfStraightSearch

A conditional block which outputs its contents if the search in progress is a regular (or "straight") search.

IfTagSearch

A conditional block which outputs its contents if the search in progress is a search of entries by tag.

IfTypeKeyToken

A conditional tag that is true when the current blog in context has been configured with a TypeKey token.

IfWebsite

A conditional tag that produces its contents when there is a website in context. This tag is useful for situations where a website may or may not be in context, such as the search template, when a search is conducted across all websites.

Example

<mt:IfWebsite>
    <!-- do something -->
<mt:Else>
    <!-- do something -->
</mt:IfWebsite>

You may be on this page because you want to use IfWebsite to test for a specific website. This tag will not do that, but this tag can be instrumental in making that determination. An expanded example:

<mt:IfWebsite>
    <!-- This is a website; now check if this is the website "My Awesome Website" -->
    <mt:If tag="WebsiteName" eq="My Awesome Website">
        <!-- Special handling for this website -->
    </mt:If>
<mt:Else>
    <!-- This is a blog -->
    <!-- do something -->
</mt:IfWebsite>

Ignore

A block tag that always produces an empty string. This tag is useful for wrapping template code you wish to disable, or perhaps annotating sections of your template.

Example:

    <mt:Ignore>
        The API key for the following tag is D3ADB33F.
    </mt:Ignore>

ImageCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

ImageCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

ImageCustomFields

This container tag iterates, or loops, over all custom fields associated with an image type asset.

See mt:EntryCustomFields for more details.

<mt:ImageCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:ImageCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:ImageCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:ImageCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:ImageCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:ImageCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

ImageCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

ImageHeight

Outputs the uploaded image height in pixels (used only for the system template for uploaded images).

ImageURL

Outputs the uploaded image URL. This tag is used only for the system template for uploaded images, specifically in the Popup Image template.

ImageWidth

Outputs the uploaded image width in pixels (used only for the system template for uploaded images).

Include

Includes the contents of a template module or external file into the current template where is it used.

<$mt:Include module="Sidebar"$>

Attributes

Note: One of the following attributes is required and not more than one may be used:


blog_id

Used to include a template from another blog in the system. Use in conjunction with the module, widget, or identifier attributes.

<$mt:Include module="Sidebar" blog_id="1"$>

Using a value of “0” will include a global template module, same as if the global attribute is used.

cache

Enables caching of the contents of the include. Used in conjunction with the ‘cache_key’ attribute. Suitable for module, widget, or identifier includes. Default value is “0”.

<mt:SetVarBlock name="cache_key"><mt:EntryCategory></mt:SetVarBlock>
<$mt:Include widget="Related Entries" key="$cache_key" ttl="3600" cache="1"$>

cache_key

Unique cache id use the template module. Used in conjunction with the ‘cache’ attribute. Suitable for module, widget, or identifier includes.

See cache for example.

file

NOTE: In Movable Type 5.13, 5.07, 4.38, and later versions, this attribute is disabled in default settings. You can enable it by specifying AllowFileInclude configuration directive.

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.

<$mt:Include file="/var/www/html/some-fragment.html"$>

global

Forces an Include of a globally defined template even if the template is also available in the blog currently in context. Default value is “0”.

<$mt:Include module="Sidebar" global="1"$>

(For module, widget, and identifier inc. Doesn’t have any effect on including file attribute.)

parent

Forces an Include of a template in the parent website. Default value is “0”.

<$mt:Include module="Sidebar" parent="1"$>

(For module, widget, and identifier inc. Doesn’t have any effect on including file attribute.)

identifier

For selecting Index templates by their unique identifier.

<$mt:Include identifier="main_index"$>

key

Alias of cache_key.

module

The name of a template module in the current blog.

<$mt:Include module="Sidebar"$>

name

For application template use: identifies an application template by filename to load.

ssi

Causes the include to be handled as a server-side include. Default value is “0”. If “1” is specified instead, mt:Include tag generates a SSI file with the format which you set in the blog settings ( [Settings] > [General] > Module Settings ).

For example if you have set it to “PHP Includes”

<$mt:Include module="Tag Cloud" ssi="1"$>

This tag outputs a php include tag:

<?php include("/path/to/blog/includes_c/tag_cloud.php") ?>

Suitable for module, widget, and identifier includes.

ttl

Specifies the lifetime in seconds of a cached template module. Suitable for module, widget or identifier includes.

See cache for example.

widget

The name of the widget in the current blog to include.

<$mt:Include widget="Search Box"$>

Examples

Also, other attributes given to this tag are locally assigned as variables when invoking the include template.

Variables in Attribute Values

Variables may be passed into the values. If various template modules were created for each category (such as “Foo Sidebar” for category “Foo” and “Bar Sidebar” for category “Bar”) then you could include the templates like this on an Entry archive template. This example also includes a default template if there is no category:

<mt:SetVarBlock name="sidebar_template"><$mt:EntryCategory$> Sidebar</mt:SetVarBlock>
<mt:If tag="EntryCategory">
    <$mt:Include module="$sidebar_template"$>
<mt:Else>
    <$mt:Include module="No Category Sidebar"$>
</mt:If>

Passing Parameters

Parameters may be defined before including a template or may be passed to the included template module as custom attribute. One variable (section_subtitle) is defined using the Var tag and the second variable (section_title) is defined as an attribute of the mt:include tag:

<$mt:Var name="section_subtitle" value="I am the subtitle"$>
<$mt:Include module="Section Header" section_title="Elsewhere"$>

The “Section Header” template module uses the values set by the include:

<h1><$mt:Var name="section_title" _default="Default Title Here"$></h1>
<h2><$mt:Var name="section_subtitle" _default="Default Subtitle Here"$></h2>

IncludeBlock

This tag is similar to a wrapper as it provides MT with the ability to 'wrap' content with an included module. This behaves much like the MTInclude tag, but it is a container tag. The contents of the tag are taken and assigned to a variable (either one explicitly named with a 'var' attribute, or will default to 'contents'). i.e.:

    <mt:IncludeBlock module="Some Module">
        (do something here)
    </mt:IncludeBlock>

In the "Some Module" template module, you would then have the following template tag allowing you to reference the contents of the IncludeBlocktag used to include this "Some Module" template module, like so:

    (header stuff)
    <$mt:Var name="contents"$>
    (footer stuff)

Important: Modules used as IncludeBlocks should never be processed as a Server Side Include or be cached

Attributes:

IndexBasename

Outputs the IndexBasename MT configuration setting.

Attributes:

IndexLink

Outputs the URL for the current index template in context. Used in an IndexList tag.

Attributes:

IndexList

A block tag that builds a list of all available index templates, sorting them by name.

IndexName

Outputs the name for the current index template in context. Used in an IndexList tag.

L

Link

Generates the absolute URL to an index template or specific entry in the system.

NOTE: Only one of the 'template', 'identifier' and 'entry_id' attributes can be specified at a time.

Attributes:

Examples:

    <a href="<mt:Link template="About Page">">My About Page</a>

    <a href="<mt:Link entry_id="221">">the entry about my vacation</a>

    <a href="<mt:Link identifier="main_index">">Home</a>

Loop

Loop over the values in a hash or an array (see mt:If).

<mt:Loop name="author_ids">
    <$mt:Var name="__key__"$> = <$mt:Var name="__value__"$>
</mt:Loop>

This tag is primarily used for processing a Perl array of hashref data in the application templates, but can also be used in blog templates.

This tag’s heritage comes from the CPAN HTML::Template module and it’s TMPL_LOOP tag and offers similar capabilities.

This tag can also handle a hashref variable, which causes it to loop over all keys in the hash.

Attributes

name

The name of the array, hash data to process.

var

Alias of name.

sort_by

Causes the data in the given array to be resorted in the manner specified.

By default the values are ouput in the order they are stored in the array/hash.

Sort by keys in reverse order:

<mt:Loop name="author_ids" sort_by="key reverse">
    <!-- something here -->
</mt:Loop>

Multiple space-separated values may be used:

glue

If specified, this string will be placed in between each “row” of data produced by the loop tag.

Loop Variables

Within the tag, the following variables are assigned and may be used:

first

Assigned when the loop is in the first iteration.

last

Assigned when the loop is in the last iteration.

odd

Assigned 1 when the loop is on odd numbered rows, 0 when even.

even

Assigned 1 when the loop is on even numbered rows, 0 when odd.

key

When looping over a hashref template variable, this variable is assigned the key currently in context.

value

This variable holds the value of the array or hashref element currently in context.

Examples

Add values to an array, then output:

<$mt:Var name="sandwich" function="push" value="bacon"$>
<$mt:Var name="sandwich" function="push" value="lettuce"$>
<$mt:Var name="sandwich" function="push" value="tomato"$>

My BLT sandwich contains the following ingredients: 
<mt:Loop name="sandwich" glue=", ">
    <$mt:Var name="__value__"$>
</mt:Loop>

Place variables into a hash using SetHashVar and then access directly via keys using the name attribute:

<mt:SetHashVar name="my_hash">
    <$mt:Var name="foo" value="bar"$>
    <$mt:Var name="fizzle" value="fozzle"$>
</mt:SetHashVar>
<mt:Loop name="my_hash">
    <$mt:Var name="fizzle" $>
    <$mt:Var name="foo" $>
</mt:Loop>

List entry categories if their label is within the set Explore, Savor, Inside, Offbeat, or Celebrate and then glue them with “, “. Using mt:SevVarBlock with function=”push” attribute and then output with mt:Loop:

<mt:EntryCategories>
    <mt:If tag="CategoryLabel" like="(Explore|Savor|Inside|Offbeat|Celebrate)">
        <mt:SetVarBlock name="featured_categories" function="push">
            <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a>
        </mt:SetVarBlock>
    </mt:If>
</mt:EntryCategories>
<mt:Loop name="featured_categories">
    <$mt:Var name="__value__" trim="1"$><mt:Unless name="__last__">, </mt:Unless>
</mt:Loop>

Loop through the last 20 entries and list each author once (skip if already found), limit to 4. This code assumes that there will be at least 4 unique bloggers in the last 20 entries. If not increase the lastn value. View a simplified version of this using Hash Variables

<$mt:Var name="author_limit" value="4"$>
<$mt:Var name="author_count" value="0"$>
<mt:Entries lastn="20">
    <mt:EntriesHeader>
<h2>Recent Bloggers</h2>
<ul>
    </mt:EntriesHeader>
    <mt:If name="author_count" lt="$author_limit">
        <$mt:EntryAuthorID setvar="current_author_id"$>
        <$mt:Var name="skip" value="0"$>
        <mt:Loop name="author_ids">
            <mt:If name="current_author_id" eq="$__value__">
                <$mt:Var name="skip" value="1"$>
            </mt:If>
        </mt:Loop>
        <mt:Unless name="skip">
    <li>
        <$mt:EntryAuthorDisplayName encode_html="1"$><br />
        <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
    </li>
        </mt:Unless>
        <$mt:EntryAuthorID setvar="author_id"$>
        <$mt:Var name="author_ids" function="push" value="$author_id"$>
    </mt:If>
    <$mt:SetVar name="author_count" op="++"$>
    <mt:EntriesFooter>
</ul>
    </mt:EntriesFooter>
</mt:Entries>

M

MarkdownOptions

Use the MarkdownOptions block tag to format content with the Markdown text formatting syntax.

By default, Markdown produces XHTML output for tags with empty elements. E.g.:

<br />

Markdown can be configured to produce HTML-style tags; e.g.:

<br>

You need to use a special <mt:MarkdownOptions> container (block) tag in each Movable Type template where you want HTML 4-style output:

<mt:MarkdownOptions output='html4'>
    ... put your entry content here ...
</mt:MarkdownOptions>

The easiest way to use MarkdownOptions is probably to put the opening tag right after your <body> tag, and the closing tag right before </body>.

To suppress Markdown processing in a particular template, i.e. to publish the raw Markdown-formatted text without translation into (X)HTML, set the output attribute to ‘raw’:

<mt:MarkdownOptions output='raw'>
    ... put your entry content here ...
</mt:MarkdownOptions>

Attributes

MaxResults

Returns the value of SearchMaxResults, specified either in configuration (via SearchMaxResults configuration directive) or in the search query parameter in the URL.

This tag is only recognized in search templates.

MTAssetBlogID

The numeric system ID of the blog of the asset currently in context. If asset belongs to the system, this template tag will return 0.

Modifiers

pad

If specify 1, the value will displays as a 6-digit string.

Example: 000001

MTContentDataSearchScript

Returns the value of the ContentSearchScript configuration setting. The default value for this setting if unassigned is “mt-ctsearch.cgi”.

MultiBlog

MultiBlog is a feature in Movable Type that allows content to be easily aggregated from multiple websites or blogs within your Movable Type install to a single website or blog.

While this page title references the MultiBlog template tag, note that it’s many features are detailed here including attributes that can be used with other tags.

Configuration

It’s likely that you’ll use both the template tags and user interface to configure how MultiBlog functions on your site.

User Interface

MultiBlog is configured through the Movable Type user interface via the Settings area under the “Tools > Plugins.” MultiBlog can be configured at the System, Website, and Blog levels and settings are inherited. That is, System-level options will be inherited by all Websites and Blogs, and Website-level options will be inherited by Blogs within that Website, for example.

Template Tags

The sources can also be configured manually via your template code directly. A number of template tags support the blog_ids template tag attribute which is used for selecting the blogs across which to aggregate content. For example, the following template tag code sample will aggregate content across blogs with an ID of 1, 2 and 5:

<mt:Entries blog_ids="1,2,5">
   <p><mt:EntryTitle></p>
</mt:Entries>

The MultiBlog Template Tag

If you wish to set a context that includes multiple blogs that can span across multiple tags, one can use the <mt:Multiblog> template tag. This tag can encapsulate any number of tags that are “multiblog enabled” (see below) and will govern their respective scopes. For example, the following template tag code sample will output the last ten comments and entries for blogs with ids 1, 5 and 8.

<mt:MultiBlog include_blogs="1,5,8">
   <mt:Entries lastn="10">
      <p><mt:EntryTitle></p>
   </mt:Entries>
   <mt:Comments lastn="10">
      <p><mt:CommentBody></p>
   </mt:Entries>
</mt:MultiBlog>

Attributes

If none of these attributes are provided, then Movable Type will default to searching the current blog context only.

MultiBlog Enabled Template Tags

The following tags support the use of the above attributes. For example:

<mt:Assets include_blogs="1,5,8">
    <p><mt:AssetTitle>: <mt:AssetURL></p>
</mt:Assets>

Context

Creating a MultiBlog context may not give you the results expected depending upon the combination of tags and attributes used, and the content available in a given blog.

As the previous notes show, the Entries template tag also supports the blog_ids attribute. But doing:

<mt:MultiBlog include_blogs="3">
    <mt:Entries category="foozball">
        some yada yada
    </mt:Entries>
</mt:MultiBlog>

is not the same thing as doing:

<mt:Entries blog_ids="3" category="foozball">
    some yada yada
</mt:Entries>

The second expects that even if the blog with id No 3 does have a category called “foozball,” that very same category must also exist in the current blog.

So if you have this:

then the second example will fail, because “foozball” isn’t a category in Blog ID 1 where MultiBlog is invoked.

MultiBlogIfLocalBlog

Type: block

Example

<mt:MultiBlogIfLocalBlog>
  <!-- do something -->
<mt:else>
  <!-- do something else -->
</mt:MultiBlogIfLocalBlog>

MultiBlogLocalBlog

Type: block

Example

<mt:MultiBlogLocalBlog>
  <!-- do something -->
</mt:MultiBlogLocalBlog>

N

NextLink

A function tag returns the URL points to the next page of the current page that is being rendered.

NoSearch

A container tag whose contents are displayed only if there is no search performed. This tag is only recognized in search templates.

Version History

There’s a problem with this tag in version 4.2: bug 81304. The NoSearch tag is not functional and is fixed in 4.21.

Meanwhile, you can actually use the <mt:If>, <mt:Else>, <mt:ElseIf> and <mt:Unless> conditional tags to get this to work. Basically, you run <mt:If> to test whether the search string evaluates to an empty string, i.e., whether it has a single alphanumeric character in it.

Example

<mt:if tag="searchstring" like="/\w/">
    <MTSearchResults>
        <MTBlogResultHeader>
            <MTIfTagSearch>
                <h2>Results for: <mt:searchstring></h2>
            </MTIfTagSearch>
            <MTIfStraightSearch>
                <h2>Search Results for: <mt:searchstring></h2>
            </MTIfStraightSearch>
        </MTBlogResultHeader>
        <ul>
            <li>
                <b><a href="<MT:EntryPermalink>" title="<MT:EntryTitle>"><mt:EntryTitle></a></b><br />
                <mt:Entrybody />
            </li>
        </ul>
    </MTSearchResults>

    <MTNoSearchResults>
        <h2>Searched for <mt:searchstring></h2>
        <p>No entries were found containing <mt:searchstring></p>
    </MTNoSearchResults>

<mt:else>

    <MTNoSearch>
        <h2>Nothing to search!</h2>
        <p>You didn't say what you're looking for. Perhaps you need to find yourself first?</p>
    </MTNoSearch>

</mt:if>

<mt:if tag="searchresultcount" eq="0">
    <h3>Instructions</h3>
    <p>By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:</p>

    <blockquote>
        "<code>movable type</code>"
    </blockquote>

    <p>The search engine also supports <code><b>AND</b></code>, <code><b>OR</b></code>, and <code><b>NOT</b></code> keywords to specify boolean expressions:</p>

    <blockquote>
        <code>publishing <b>OR</b> personal</code>
    </blockquote>

    <blockquote>
        <code>publishing <b>NOT</b> dynamic</code>
    </blockquote>
</mt:if>

The logic is this:

  1. If the search string has some term in it, then:
    a. show the results if any are found; or
    b. show no results found for that string;
  2. If the search string does not have a search term at all (the string is empty), fire the <mt:NoSearch> code chunk.

Finally, if <mt:SearchResultCount> evaluates to zero (there are no search results; which is true whenever nothing is found and also when nothing is specified to find), display instructions.

NoSearchResults

A container tag whose contents are displayed if a search is performed but no results are found.

This tag is only recognized in search templates.

NotifyScript

Note: Support for this configuration directive was removed in Movable Type 5.11 as it was rendered obsolete.

Returns the value of the NotifyScript configuration setting. The default for this setting if unassigned is "mt-add-notify.cgi".

O

OtherBlog

The OtherBlog template tag is an alias of MultiBlog.

The MultiBlog template tag is preferred, if only because the plugin that adds this capability is named MultiBlog.

OtherProfiles

This block template tag outputs a summary of services users have registered with Movable Type.   This tag can only be used with MT 4.25 and above.

Example:

<$mt:SetVar name="display_name" value="Melody"$>

<mt:OtherProfiles display_name="$display_name">
<mt:If name="__first__">
<div class="widget-elsewhere widget">
<h3 class="widget-header"><$mt:Var name="display_name"$> 's service summary</a></h3>
<div class="widget-content">
<ul>
</mt:If>
<li class="service-<$mt:OtherProfileVar name="type"$>"><a href="<$mt:OtherProfileVar name="uri" escape="html"$>"><$mt:OtherProfileVar name="label" escape="html"$></a></li>
<mt:If name="__last__">
</ul>
</div>
</div>
</mt:If>
</mt:OtherProfiles>

Attributes:

OtherProfileVar

This tag is a part of the Action Streams plugin bundled with Movable Type 4.25 and higher.

Provides a property of the current author profile, available in an <mt:OtherProfiles> loop.

Example:

<mt:OtherProfiles>
    <$mt:OtherProfileVar name="label"$>:
    <$mt:OtherProfileVar name="uri"$>
</mt:OtherProfiles>

Attributes:

P

PageAssets

A container tag which iterates over a list of assets for the current page in context. Supports all the attributes provided by the Assets tag.

PageAuthorDisplayName

The display name of the author of the page in context. If no display name is specified, returns an empty string, and no name is displayed.

Example:

    <$mt:PageAuthorDisplayName$>

PageAuthorEmail

The email address of the page's author.

Note: It is not recommended to publish email addresses.

Example:

    <$mt:PageAuthorEmail$>

PageAuthorLink

A linked version of the author's user name, using the author URL if provided in the author's profile. Otherwise, the author name is unlinked. This tag uses the author URL if available and the author email otherwise. If neither are on record the author name is unlinked.

Attributes:

Examples:

    <$mt:PageAuthorLink$>

    <$mt:PageAuthorLink new_window="1"$>

PageAuthorURL

The URL of the page's author.

Example:

    <$mt:PageAuthorURL$>

PageBasename

By default, the page basename is a constant and unique identifier for an page which is used as part of the individual pages's archive filename.

The basename is created by dirifiying the page title when the page is first saved (regardless of the page status). From then on, barring direct manipulation, the page basename stays constant even when you change the page's title. In this way, Movable Type ensures that changes you make to an page after saving it don't change the URL to the page, subsequently breaking incoming links.

The page basename can be modified by anyone who can edit the page. If it is modified after it is created, it is up to the user to ensure uniqueness and no incrementing will occur. This allows you to have complete and total control over your URLs when you want to as well as effortless simplicity when you don't care.

Attributes:

Example:

    <$mt:PageBasename$>

PageBody

This tag outputs the contents of the page's Body field.

If a text formatting filter has been specified, it will automatically applied.

Attributes:

Example:

    <$mt:PageBody$>

PageCustomFieldDescription

Deprecated: Same as mt:CustomFieldDescription. See EntryCustomFields for more info.

This will display the description of the current custom field in context.

PageCustomFieldName

Deprecated: Same as mt:CustomFieldName. See EntryCustomFields for more info.

This will display the name of the current custom field in context.

PageCustomFields

This container tag iterates, or loops, over all custom fields associated with a page.

See mt:EntryCustomFields for more details.

<mt:Pages>
    <mt:PageCustomFields>
        <$mt:CustomFieldName$>
    </mt:PageCustomFields>
</mt:Pages>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:PageCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:PageCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:PageCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:PageCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

PageCustomFieldValue

Deprecated: Same as mt:CustomFieldValue. See EntryCustomFields for more info.

This will display the value of the current custom field in context.

PageDate

The authored on timestamp for the page.

Attributes:

Example:

    <$mt:PageDate$>

PageExcerpt

This tag outputs the contents of the page Excerpt field if one is specified or, if not, an auto-generated excerpt from the page Body field followed by an ellipsis (“…”). If an excerpt is auto-generated also note that any HTML is stripped.

The length of the auto-generated output of this tag can be set in the blog’s Entry Settings.

Attributes

Example

 <mt:PageExcerpt words="100" convert_breaks="1">

Below is a more complex example. This example grabs the EntryExcerpt, but only if one has been manually created in the Excerpt field, then saves it to the excerpt variable. That excerpt variable is then tested

<mt:PageExcerpt no_generate="1" setvar="excerpt">
<mt:If name="excerpt">
    <mt:PageExcerpt>
<mt:Else>
    <mt:PageBody>
</mt:If>

PageFolder

A container tag which holds folder context relating to the page.

<mt:PageFolder>
    <$mt:FolderLabel$>
</mt:PageFolder>

Tip: Due to legacy taging the mt:EntryCategory function tag will output the same value as the mt:FolderLabel function tag when used in the context of a page. Unlike the mt:PageFolder tag which is block tag and must be used with the mt:FolderLabel tag.

Use this mtml

 <mt:If tag="EntryCategory" eq="Appendix: Configuration Directives">
   This main folder for this page is "Appendix: Configuration Directives".
   Confirmation using `mt:EntryCategory`: "<$mt:EntryCategory$>".
 </mt:If>

PageID

A numeric system ID of the Page currently in context.

Example:

    <$mt:PageID$>

PageIfTagged

This template tag evaluates a block of code if a tag has been assigned to the current page in context.

If the tag attribute is not assigned, then the template tag will evaluate if any tag is present.

Check for a specific tag…

<mt:PageIfTagged tag="Foo">
    This page has the tag "Foo"
</mt:PageIfTagged>

Check if any tags are assigned to the page…

<mt:PageIfTagged>
    This page has tags
</mt:PageIfTagged>

Context

Attributes

tag

If present, the template tag will evaluate if the specified tag is assigned to the current page.

include_private=”0”

Include private tag if “1” is set.

Example

Conditional if tagged “Foo” or not:

<mt:PageIfTagged tag="Foo">
    <!-- do something -->
<mt:Else>
    <!-- do something else -->
</mt:PageIfTagged>

Condition based upon if a page is tagged with the private tag @draft:

<mt:Pages>
    <li class="page <mt:PageIfTagged tag="@draft">draft</mt:PageIfTagged>">
        <a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a>
        <mt:PageIfTagged tag="@draft">(draft)</mt:PageIfTagged>
    </li>
</mt:Pages>

Bugs

Related

PageKeywords

The specified keywords of the page in context.

Example:

    <$mt:PageKeywords$>

PageModifiedDate

The last modified timestamp for the page.

Attributes:

Example:

    <$mt:PageModifiedDate$>

PageMore

This tag outputs the contents of the page's Extended field.

If a text formatting filter has been specified it will automatically applied.

Attributes:

Example:

    <$mt:PageMore$>

PageNext

A container tag providing a context for the page immediately following the current page.

Modifiers

Bug: In Movable Type 4.x there is a bug where if pages have the exact same date-time then the mt:PagePrevious and mt:PageNext container tags may skip a page. This has been fixed in Movable Type 5.

Example

<mt:Pages>
    <mt:EntryTitle>
    <mt:PageNext>
        The next page is:
        <a href="<mt:PagePermalink>"><mt:PageTitle></a>
    </mt:PageNext>
</mt:Pages>

Related

PagePermalink

An absolute URL pointing to the archive page containing this entry. An anchor (#) is included if the permalink is not pointing to an Individual Archive page.

Example:

    <$mt:PagePermalink$>

PagePrevious

A container tag providing a context for the entry immediately preceding the current page.

Modifiers

Bug: In Movable Type 4.x there is a bug where if pages have the exact same date-time then the mt:PagePrevious and mt:PageNext container tags may skip a page. This has been fixed in Movable Type 5.

Example

<mt:Pages>
    <mt:PageTitle>
    <mt:PagePrevious>
        The previous page is:
        <a href="<mt:PagePermalink>"><mt:PageTitle></a>
    </mt:PagePrevious>
</mt:Pages>

Related

PagerBlock

A block tag iterates from 1 to the number of the last page in the search result. For example, if the limit was 10 and the number of results is 75, the tag loops from 1 through 8.

The page number is set to __value__ standard variable in each iteration.

The tag also sets __odd__, __even__, __first__, __last__ and __counter__ standard variables.

Example:

    M
    <MTPagerBlock>
      <MTIfCurrentPage>o<MTElse><a href="<MTPagerLink>">o</a></MTIfCurrentPage>
    </MTPagerBlock>
    vable Type

produces:

    "Mooooooooovable Type" where each "o" is a link to the page.

PagerLink

A function tag returns the URL points to the page in the context of PagerBlock. The tag can only be used in the context of PagerBlock.

Pages

A block tag which iterates over a list of published pages from a blog and outputs a selection of pages that are appropriate for the context used and the template being published.

<mt:Pages>
    <mt:PageTitle>
    <mt:PageBody>
</mt:Pages>

A pages is a class of Entry, essentially non-date-based Entries. Thus all attributes of the Entries tag can also be used with Pages. Refer to the Entries documentation for all of its attributes, sorting options, and examples.

Page-related tags can be used inside the mt:Pages loop block. Most page-related tags are alias’ of Entry-related tags, thus most can be used interchangeably.

In the same way folder is a class of category.

Attributes

All of the non entry-specific attributes of Entries can be used with Pages. Refer to the Entries documentation for all of its attributes, sorting options, and examples.

Attributes unique to Pages:


folder

Filter the resulting pages by a particular folder. Use the Folder Label (not Folder Basename) as the value. Similar to Entries “category” attribute.

<mt:Pages folder="About Us">
    <mt:PageTitle>
</mt:Pages>

include_subfolders

Boolean value, 1 or 0 (default). If specified in conjunction with the folder attribute, pages assigned to subfolders of the identified folder/folders will be included in the set of pages. Similar to the “include_subcategories” attribute in Entries.

Specify ‘1’ to cause all pages that may exist within subfolders to the folder in context to be included.

Return pages in the folder “About Us” and any pages in subfolders of the “About Us” folder:

<mt:Pages folder="About Us" include_subfolders="1">
    <mt:PageTitle>
</mt:Pages>

no_folder

Returns all pages not associated to a folder.

<mt:Pages no_folder="1">
    <mt:PageTitle>
</mt:Pages>

Example

See the Entries template tag for all attributes and examples.

Display the 10 most recent pages in the folder “Locations”:

<mt:Pages folder="Locations" lastn="10">
    <mt:PageTitle>
</mt:Pages>

Display the pages in the folder “Locations” sorted by title, listed in ascending order:

<mt:Pages folder="Locations" sort_by="title" sort_order="ascend">
    <mt:PageTitle>
</mt:Pages>

PagesFooter

The contents of this container tag will be displayed when the last page listed by a Pages tag is reached.

PagesHeader

The contents of this container tag will be displayed when the first page listed by a Pages tag is reached.

Example:

    <mt:Pages glue=", ">
        <mt:PagesHeader>
            The following pages are available:
        </mt:PagesHeader>
        <a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a>
    </mt:Pages>

PageTags

A container tag which create a context about the assigned tags. Analogous to EntryTags.

Attributes:

Example:

Listing out the page's tags, separated by commas:

    <mt:PageTags glue=", "><$mt:TagName$></mt:PageTags>

PageTitle

The title of the page in context.

Example:

    <$mt:PageTitle$>

ParentCategories

A block tag that lists all the ancestors of the current category.

Output all parent categories and glue using a forward slash:

<mt:ParentCategories glue ="/">
    <$mt:CategoryLabel$>
</mt:ParentCategories>

The above templating will output something like the following:

Parent Category/Sub-Category/Sub-Sub-Category

Attributes

exclude_current

This optional boolean attribute controls the exclusion of the current category in the list.

glue

This optional attribute is a shortcut for connecting each category label with its value.

Examples

Breadcrumbs

Use the following code on Category archive template. If the current category has a parent category, loop through the parent categories starting at the top level (excluding the current category), then output the title of the current archive.

<mt:HasParentCategory>
    <mt:ParentCategories exclude_current="1">
        <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a> /
    </mt:ParentCategories>
</mt:HasParentCategory>
<$mt:ArchiveTitle$>

On an Entry archive template:

<mt:HasParentCategory>
    <mt:ParentCategories>
        <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a> /
    </mt:ParentCategories>
</mt:HasParentCategory>
<$mt:EntryTitle$>

The glue attribute can be used to create “fancy” breadcrumbs:

<mt:ParentCategories glue ="&nbsp;&raquo;&nbsp;">
    <$mt:CategoryLabel$>
</mt:ParentCategories>

Which outputs:

Parent Category » Sub-Category » Sub-Sub-Category

ParentCategory

A container tag that creates a context to the current category’s parent, if category is assigned a parent category.

Example

List all the categories and link to parent category if category in context has a parent category:

<ul>
<mt:Categories>
    <li>
    <a href="<mt:ArchiveLink>"><mt:CategoryLabel></a>
    <mt:ParentCategory>
        (Parent Category: <a href="<mt:ArchiveLink>"><mt:CategoryLabel></a>)
    </mt:ParentCategory>
    </li>
</mt:Categories>
</ul>

block, category, template tag

ParentFolder

A container tag that creates a context to the current folder's parent.

Example:

    <mt:ParentFolder>
        Up: <a href="<mt:ArchiveLink>"><mt:FolderLabel></a>
    </mt:ParentFolder>

ParentFolders

A block tag that lists all the ancestors of the current folder.

Attributes:

PasswordValidation

This tag outputs the JavaScript code to validate the user input. Specify the following attributes:

The following is the example of use in the Community Forum's "New Password Form" global template.


        <mt:var name="screen_id" value="change-password">
        <mt:var name="body_class" value="sign-in">
        <mt:setvarblock name="page_title">Change Password</mt:setvarblock>
        <mt:setvar name="complete" value="1">
        <mt:SetVarBlock name="title"><mt:If name="blog_id"><$mt:BlogName encode_html="1"$>: </mt:If><$mt:Var name="page_title"$></mt:SetVarBlock>

        <$mt:Include module="Simple Header"$>

        <mt:if name="error">
        <mtapp:statusmsg
        id="error"
        class="error"
        can_close="0">
        <mt:var name="error">
        </mtapp:statusmsg>
        </mt:if>

        <script type="text/javascript">
        /* <![CDATA[ */
        <$mt:PasswordValidation form="password_reset_form" password="password" username="username"$>
        /* ]]> */
        </script>

        <form id="password_reset_form" method="post" action="<mt:var name="script_url">">
        <input type="hidden" name="__mode" value="new_pw" />
        <input type="hidden" name="token" value="<mt:var name="token" escape="html">" />
        <input type="hidden" name="email" value="<mt:var name="email" escape="html">" />
        <input type="hidden" name="username" id="username" value="<mt:var name="username" escape="html">" />
        <fieldset>

        <mtapp:setting
        id="name"
        label="New Password"
        hint="Enter the new password. (<$mt:PasswordValidationRule$>)"
        show_hint="1"
        label_class="top-label">
        <input type="password" name="password" id="password" class="text password full" value="<mt:var name="password" escape="html">" />
        </mtapp:setting>

        <mtapp:setting
        id="name"
        label="Confirm New Password"
        label_class="top-label">
        <input type="password" name="password_again" id="password_again" class="text password full" value="<mt:var name="password_again" escape="html">" />
        </mtapp:setting>

        <div class="actions-bar actions-bar-login">
        <button
        type="submit"
        accesskey="s"
        title="Change"
        class="action primary button">
        Change</button>
        </div>

        </fieldset>
        </form>
        <$mt:Include module="Simple Footer"$>

PasswordValidationRule

This tag outputs the active password rules. No attribute.


<mtapp:setting
    id="name"
    label="New Password"
    hint="Enter the new password. (<$mt:PasswordValidationRule$>)"
    show_hint="1"
    label_class="top-label">
    <input type="password" name="password" id="password" class="text password full" value="<mt:var name="password" escape="html">" />
</mtapp:setting>

PingBlogName

The site name that sent the TrackBack ping.

Example:

    <$mt:BlogName$>

PingDate

The timestamp of when the ping was submitted. Date format tags may be applied with the format attribute along with the language attribute.

Attributes:

Example:

    <$mt:PingDate$>

PingEntry

Provides an entry context for the parent entry of the TrackBack ping in context.

Example:

    Last TrackBack received was for the entry
    titled:
    <mt:Pings lastn="1">
        <mt:PingEntry>
            <$mt:EntryTitle$>
        </mt:PingEntry>
    </mt:Pings>

PingExcerpt

An excerpt describing the URL of the ping sent.

Example:

    <$mt:PingExcerpt$>

PingID

A numeric system ID of the TrackBack ping in context.

Example:

    <$mt:PingID$>

PingIP

The IP (Internet Protocol) network address the TrackBack ping was sent from.

Example:

    <$mt:PingIP$>

PingRank

A function tag which returns a number from 1 to 6 (by default) which represents the rating of the TrackBack ping in context in terms of total score where '1' is used for the highest score, '6' for the lowest score.

Attributes:

Example:

    <$mt:PingRank namespace="FiveStarRating"$>

Pings

A context-sensitive container tag that lists all of the pings sent to a particular entry, category or blog. If used in an entry context the tagset will list all pings for the entry. Likewise for a TrackBack-enabled category in context. If not in an entry or category context, a blog context is assumed and all associated pings are listed.

Attributes

MultiBlog attributes

PingScore

A function tag that provides total score of the TrackBack ping in context. Scores grouped by namespace of a plugin are summed to calculate total score of a TrackBack ping.

Attributes:

Example:

    <$mt:PingScore namespace="FiveStarRating"$>

PingScoreAvg

A function tag that provides the avarage score of the TrackBack ping in context. Scores grouped by namespace of a plugin are summed to calculate total score of a TrackBack ping, and average is calculated by dividing the total score by the number of scorings or 'votes'.

Attributes:

Example:

    <$mt:PingScoreAvg namespace="FiveStarRating"$>

PingScoreCount

A function tag that provides the number of scorings or 'votes' made to the TrackBack ping in context. Scorings grouped by namespace of a plugin are summed.

Attributes:

Example:

    <$mt:PingScoreCount namespace="FiveStarRating"$>

PingScoreHigh

A function tag that provides the highest score of the TrackBack ping in context. Scorings grouped by namespace of a plugin are sorted to find the highest score of a TrackBack ping.

Attributes:

Example:

    <$mt:PingScoreHigh namespace="FiveStarRating"$>

PingScoreLow

A function tag that provides the lowest score of the TrackBack ping in context. Scorings grouped by namespace of a plugin are sorted to find the lowest score of a TrackBack ping.

Attributes:

Example:

    <$mt:PingScoreLow namespace="FiveStarRating"$>

PingsFooter

The contents of this container tag will be displayed when the last ping listed by a Pings tag is reached.

PingsHeader

The contents of this container tag will be displayed when the first ping listed by a Pings tag is reached.

PingsSent

A container tag representing a list of TrackBack pings sent from an entry. Use the PingsSentURL tag to display the URL pinged.

Example:

    <h4>Ping'd</h4>
    <ul>
    <mt:PingsSent>
        <li><$mt:PingsSentURL$></li>
    </mt:PingsSent>
    </ul>

PingsSentURL

The URL of the TrackBack ping was sent to. This is the TrackBack Ping URL and not a permalink.

Example:

    <$mt:PingsSentURL$>

PingTitle

The title of the remote resource that the TrackBack ping sent.

Example:

    <$mt:PingTitle$>

PingURL

The URL of the remote resource that the TrackBack ping sent.

Example:

    <$mt:PingURL$>

PreviousLink

A function tag returns the URL points to the previous page of the current page that is being rendered.

ProductName

The Movable Type edition in use.

Attributes:

Example:

    <$mt:ProductName$>

for the MTOS edition, this would output:

    Movable Type Open Source

ProfileServices

This tag is a part of the Action Streams plugin bundled with Movable Type 4.25 and higher.

This block template tag lists the services possible for user registration and display of content on their Movable Type author profile.

Example:

<mt:ProfileServices>
    <mt:If name="__first__">
        <ul>
    </mt:If>
        <li><mt:Var name="label"></li>
    <mt:If name="__last__">
        </ul>
    </mt:If>
</mt:ProfileServices>

Attributes:

You can use the following variables in mt:ProfileServices block tags:

<$mt:Var name="Variable Name"$>
<-->
Variable Name Output Sample
label The name of the service TypePad
type The type of service Vox ("vox"), TypePad ("typepad")
ident_label Label of the ID field of your Action Streams accounts Profile ID
ident_example Outputs a sample of the account name
ident_prefix Predetermined prefix for username you enter when adding a service account http://profile.typepad.com
ident_suffix Predetermined suffix for username you enter when adding a service account .vox.com
ident_hint Hint for username you enter when adding a service account

PublishCharset

The value of the PublishCharset directive in the system configuration.

Example:

    <$mt:PublishCharset$>

R

RemoteSignInLink

Outputs a link to the MT Comment script to allow signing in to a TypeKey configured blog. NOTE: This is deprecated in favor of SignInLink.

RemoteSignOutLink

Outputs a link to the MT Comment script to allow a user to sign out from a blog. NOTE: This tag is deprecated in favor of SignOutLink.

S

ScoreDate

Provides the date of the score in context. See Date for formatting attributes.

SearchIncludeBlogs

Used in the search result template to pass the IncludeBlogs parameters through from the search form keeping the context of any followup search the same as the initial search.

Example:

    <input type="hidden" name="IncludeBlogs" value="<$mt:SearchIncludeBlogs$>" />

SearchMaxResults

Returns the value of the SearchMaxResults or MaxResults configuration setting. Use SearchMaxResults because MaxResults is considered deprecated.

SearchResultCount

Return the number of results found across all of the blogs searched. This tag is only recognized in search templates.

Attributes

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:SearchResultCount singular="1 entry">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:SearchResultCount plural="# entries">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:SearchResultCount none="No entries">

or

<mt:SearchResultCount none="None">

Example

This returns

"1 entry" or "9 entries" or "No entry".

SearchResults

A container tag that creates a list of search results. This tag creates an entry and blog context that all Entry and Blog tags can be used. This tag is only recognized in search templates.

Attributes

The SearchSortBy and SearchResultDisplay configuration directives, if used, will override these options.

Example

<mt:SearchResults sort_by="title" sort_order="ascend">
    ... Search result item ...
</mt:SearchResults>

SearchResultsFooter

The content of this block tag is rendered when the item in context from search results are the last item of the result set. You can use the block to render closeing tags of a HTML element, for example.

This tag is only recognized in SearchResults block.

Example:

    <mt:SearchResultsFooter>
    <p>If you didn't find what you were looking for, you can also peruse
    the <a href="<mt:Link identifier="archive_index">">site archives</a>.</p>
    </mt:SearchResultsFooter>

SearchResultsHeader

The content of this block tag is rendered when the item in context from search results are the first item of the result set. You can use the block to render headings and titles of the result table, for example.

This tag is only recognized in SearchResults block.

Example:

    <mt:SearchResultsHeader>
    <h3>Look what we found!</h3>
    </mt:SearchResultsHeader>

SearchScript

Returns the value of the SearchScript configuration setting. The default for this setting if unassigned is "mt-search.cgi".

SearchString

An HTML-encoded search query. This tag is only recognized in search templates.

Example:

    <$mt:SearchString$>

SearchTemplateBlogID

Returns the ID of the blog that loaded the template.

SearchTemplateID

Returns the identifier of the search template (ie, "feed" or "nomorepizzaplease").

Example:

    <$mt:SearchTemplateID$>

Section

A utility block tag that is used to wrap content that can be cached, or merely manipulated by any of Movable Type's tag modifiers.

Attributes:

SetHashVar

A block tag that is used for creating a hash template variable. A hash is a variable that stores many values. You can even nest SetHashVar tags so you can store hashes inside hashes for more complex structures.

Example:

    <mt:SetHashVar name="my_hash">
        <$mt:Var name="foo" value="bar"$>
        <$mt:Var name="fizzle" value="fozzle"$>
    </mt:SetHashVar>

Then later:

    foo is assigned: <$mt:Var name="my_hash{foo}"$>

SetVar

A function tag used to set the value of a template variable.

For simply setting variables you can use the Var tag with a value attribute to assign template variables.

Attributes

Related Tags

SetVarBlock

A block tag used to set the value of a template variable. Note that you can also use the global 'setvar' modifier to achieve the same result as it can be applied to any MT tag.

Attributes:


Related Tags:

SetVars

A block tag that is useful for assigning multiple template variables at once.

Example:

    <mt:SetVars>
    title=My Favorite Color
    color=Blue
    </mt:SetVars>

Then later:

    <h1><$mt:Var name="title"$></h1>

<ul><li><$mt:Var name="color"$></li></ul>

Related Tags:


SetVarTemplate

Similar to the SetVarBlock tag, but does not evaluate the contents of the tag, but saves it for later evaluation, when the variable is requested. This allows you to create inline template modules that you can use over and over again.

Attributes:

Example:

    <mt:SetVarTemplate name="entry_title">
<h1><$MTEntryTitle$></h1>
</mt:SetVarTemplate>

<mt:Entries>
<$mt:Var name="entry_title"$>
</mt:Entries>

Related Tags:


SignInLink

Outputs a link to the MT Comment script to allow a user to sign in to comment on the blog.

SignOnURL

The value of the SignOnURL configuration setting.

SignOutLink

Outputs a link to the MT Comment script to allow a signed-in user to sign out from the blog.

SmartyPantsVersion

Type: function

Example

<mt:SmartyPantsVersion />

StaticFilePath

The file path to the directory where Movable Type's static files are stored (as configured by the StaticFilePath setting, or based on the location of the MT application files alone). This value is guaranteed to end with a "/" character.

StaticWebPath

The value of the StaticWebPath configuration setting. If this setting has no domain, the blog domain is added to it. This value is guaranteed to end with a "/" character.

Example:

    <img src="<$mt:StaticWebPath$>images/powered.gif"
        alt="Powered by MT" />

StatsSnippet

Generates script required to integrate your website with a statistics service such as Google Analytics.

Output

StreamAction

This tag is a part of the Action Streams plugin bundled with Movable Type 4.25 and higher.

Provides the recipe authors' suggested markup for the action in context.

Example:

<mt:ActionStreams lastn="10">
    <li><mt:StreamAction></li>
</mt:ActionStreams>

Attributes:

StreamActionDate

This functional template tag outputs the date of the action.

This is a part of the ActionStreams plugin and MT 4.25

 
Example:
<mt:ActionStreams>
<mt:DateHeader>
<div>
<h3><$mt:StreamActionDate format="%b %d, %Y"$></h3>
<ul>
</mt:DateHeader>
<li class="service-<$mt:var name="service_type"$>"><mt:StreamActionDate format="%H:%M"> - <$MTStreamAction$></li>
<mt:DateFooter>
</ul>
</div>
</mt:DateFooter>
</mt:ActionStreams>

Modifier
You can use the same modifiers with this tag as those used with the <mt:Date> function tag.

StreamActionID

This functional template tag outputs action IDs. It's a part of the ActionStreams plugin for use with MT 4.25.

Example:

<mt:ActionStreams>
<mt:DateHeader>
<div>
<h3><$mt:StreamActionDate format="%b %d, %Y"$></h3>
<ul>
</mt:DateHeader>
<li id="action-<$mt:StreamActionID$>" class="service-<$mt:var name="service_type"$>"><mt:StreamActionDate format="%H:%M"></abbr> - <$MTStreamAction$></li>
<mt:DateFooter>
</ul>
</div>
</mt:DateFooter>
</mt:ActionStreams>

StreamActionModifiedDate

This functional template tag outputs the date an action was modified.   It is a part of the ActionStreams plugin for use with MT 4.25.

For example, the tag for when an entry was submitted to Vox is <mt:StreamActionDate>. The date the entry received a comment or was updated is output as <mt:StreamActionModifiedDate>.

Example:
<mt:ActionStreams lastn="15">
<mt:If name="__first__">
<div class="widget-recent-action widget-recent widget">
<h3 class="widget-header">15 recent actions</a></h3>
<div class="widget-content">
<ul>
</mt:If>
<li class="service-<$mt:var name="service_type"$>"><mt:StreamActionModifiedDate format="%H:%M"> - <a href="<$mt:StreamActionURL$>"><$mt:StreamActionTitle$></a></li>
<mt:If name="__last__">
</ul>
</div>
</div>
</mt:If>

</mt:ActionStreams>
Modifier

The modifiers compatible with this tag are the same as those compatible with the <mt:Date> function tag. 

StreamActionRollup

This block template tag is for outputting actions in groups according to special rules.   It is a part of the ActionStreams plugin in MT 4.25.


Example
 
<mt:ActionStreams lastn="30">
<mt:If name="__first__">
<ul>
</mt:If>

<mt:StreamActionRollup by="stream">
<mt:If name="__first__">
<li><mt:StreamActionDate format_name="iso8601">l - <$mt:AuthorDisplayName escape="html"$> saved
<mt:Else name="__last__">
<mt:Ignore>If there are more than 3 actions, use 『A, B and C』display</mt:Ignore>
and
<mt:Else>
<mt:Ignore>If there are more than 3 actions, use 『A, B and C』display</mt:Ignore>
,
</mt:If>
<a href="<mt:StreamActionURL escape="html">"><$mt:StreamActionTitle escape="html"$></a>
<mt:If name="__last__">
</li>
</mt:If>

<mt:Else>
<mt:Ignore>use this template to deal with actions that can't be organized</mt:Ignore>
<li><mt:StreamActionDate format_name="iso8601"> - <$mt:StreamAction$></li>

</mt:StreamActionRollup>

<mt:If name="__last__">
</ul>
</mt:If>

</mt:ActionStreams>


Modifiers


Sets which actions to treat the same. Actions are outputted according to these settings.
Default settings are date, action.


StreamActionTags

When an action has tags, this block tag outputs a summary of those tags.

StreamActionThumbnailURL

This functional template tag outputs thumbnails for photos and movies in an action.  Not all services are compatible and items from incompatible services will not be output.

This template tag is a part of ActionStreams and MT 4.25 and above.

Example:
<mt:ActionStreams>
<mt:DateHeader>
<div>
<h3><$mt:StreamActionDate format="%b %d, %Y"$></h3>
<ul>
</mt:DateHeader>
<li class="service-<$mt:var name="service_type"$>">
<mt:StreamActionDate format="%H:%M"> - <$MTStreamAction$>
<mt:If tag="StreamActionThumbnailURL">
<div class="picture">
<img alt="<$mt:StreamActionTitle$> Image Title" src="<$mt:StreamActionThumbnailURL$>"/>
</div>
</mt:If>
</li>
<mt:DateFooter>
</ul>
</div>
</mt:DateFooter>
</mt:ActionStreams>
 

StreamActionTitle

This functional template tag outputs an action's title.

This tag is a part of ActionStreams and MT 4.25.

Example:
<mt:ActionStreams lastn="15">
<mt:If name="__first__">
<div class="widget-recent-action widget-recent widget">
<h3 class="widget-header">15 recent actions</a></h3>
<div class="widget-content">
<ul>
</mt:If>
<li class="service-<$mt:var name="service_type"$>"><a href="<$mt:StreamActionVia$>"><$mt:StreamActionTitle$></a></li>
<mt:If name="__last__">
</ul>
</div>
</div>
</mt:If>
</mt:ActionStreams>

StreamActionURL

This tag is a part of the Action Streams plugin bundled with Movable Type 4.25 and higher.

Provides the URL of the web asset associated with the current stream action.

Example:

<mt:ActionStreams lastn="10">
    <li>
        <a href="<mt:StreamActionURL escape="html">"><mt:StreamActionTitle></a>
    </li>
</mt:ActionStreams>

StreamActionVar

This Template Tag assigns parameters to refer to each variable that corresponds to an action. Use this to output items other than titles and URLs when using plugins to expand services.

This is a part of the ActionStreams plugin that comes with MT 4.25.

Example:
<mt:ActionStreams lastn="15">
<mt:If name="__first__">
<div class="widget-recent-action widget-recent widget">
<h3 class="widget-header">15 recent actions</a></h3>
<div class="widget-content">
<ul>
</mt:If>
<li class="service-<$mt:var name="service_type"$>"><a href="<$mt:StreamActionVar name="url"$>"><$mt:StreamActionVar name="title"$></a></li>
<mt:If name="__last__">
</ul>
</div>
</div>
</mt:If>
</mt:ActionStreams>

Default Usage:
<$mt:StreamActionVar name="parameter"$>


Possible Parameters

SubCategories

A specialized version of the mt:Categories block tag that respects the hierarchical structure of categories.

<mt:SubCategories top="1">
    <!-- do something -->
</mt:SubCategories>

Attributes

Use of either top or category attribute is required.

category

Specifies a specific category by name for which to return categories.

<mt:SubCategories category="Italian">
    <!-- do something -->
</mt:SubCategories>

If two categories have the same label (“Italian” in this case), they can be specified by listing their parent category label followed by the cateory name, separated by a slash:

<mt:SubCategories category="Restaurants/Italian">
    <!-- do something -->
</mt:SubCategories>
<mt:SubCategories category="Recipes/Italian">
    <!-- do something -->
</mt:SubCategories>

If category label contains a slash (such as “Indian/Pakistani”) surround the value with square brackets:

<mt:SubCategories category="Restaurants/[Indian/Pakistani]">
    <!-- do something -->
</mt:SubCategories>

Either top or category is required.

include_current

A boolean attribute controling inclusion of the current category specified in the category attribute in the list.

sort_by MT5.1

Specifies the sort key. The following options are available. This attribute was introduced in Movable Type 5.1.

The default value is user_custom. It produces the sort order you specified on the Manage Categories screen. This attribute is ignored if sort_method has been set.

Display a reversed list of top-level categories sorted by the label:

<mt:SubCategories top="1" sort_by="label" sort_order="descend">
    <!-- do something -->
</mt:SubCategories>

sort_order

Specifies the sort order. Values “ascend” (default) and “descend”. This attribute is ignored if sort_method has been set.

sort_method

An advanced usage attribute. A fully qualified Perl method name to be used to sort the categories. This attribute is not supported in the dynamic publishing.

<mt:SubCategories sort_method="Your::Perl::Package::sort_by_entry_count">
    <!-- do something -->
</mt:SubCategories>

top

If set to 1, displays only top level categories. Same as using TopLevelCategories.

List of top-level categories:

<mt:SubCategories top="1">
    <!-- do something -->
</mt:SubCategories>

Examples

Subcategories

List the subcategories of “Category AAA”

<ul>
<mt:SubCategories category="Cat AAA">
    <li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
</mt:SubCategories>
</ul>

Recursive Category List

Recursively list all categories starting with top-level categories, only linking categories that contain entries (using mt:CategoryCount). (Using mt:SubCatIsFirst and mt:SubCatIsLast to condition for the first and last loops respectively):

<mt:SubCategories top="1">
    <mt:SubCatIsFirst>
        <ul>
    </mt:SubCatIsFirst>
    <mt:If tag="CategoryCount">
            <li>
                <a href="<$mt:CategoryArchiveLink$>" title="<$mt:CategoryDescription$>"><mt:CategoryLabel></a>
    <mt:Else>
            <li>
                <$mt:CategoryLabel$>
    </mt:If>
    <$mt:SubCatsRecurse$>
    </li>
    <mt:SubCatIsLast>
        </ul>
    </mt:SubCatIsLast>
</mt:SubCategories>

Display Parent, Sibling and Child Categories

Modify the following for your specific use case.

Use the following mtml on a Category archive to list related categories. List parent and child categories of the current category. If current category has a parent category, then return the parent category and any sub categories. If the current category does not have a parent category then just display subcategories…

<$mt:CategoryLabel setvar="CategoryLabel"$>
<mt:HasParentCategory>
    <mt:ParentCategory>
        <$mt:CategoryLabel setvar="ParentCategoryLabel"$>
        <li>Parent: <a href="<$mt:ArchiveLink$>"><$mt:CategoryLabel$></a></li>
        <mt:SubCategories category="$ParentCategoryLabel">
            <mt:If tag="CategoryLabel" ne="$ParentCategoryLabel">
                <li>Sibling: <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
            </mt:If>
        </mt:SubCategories>
        <li>Current: <$mt:Var name="CategoryLabel"$></li>
        <mt:SubCategories category="$CategoryLabel">
            <mt:If tag="CategoryLabel" ne="$CategoryLabel">
                <li>Child: <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
            </mt:If>
        </mt:SubCategories>
    </mt:ParentCategory>
<mt:Else>
    <mt:SubCategories top="1">
        <li>Sibling: <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
    </mt:SubCategories>
        <li>Current: <$mt:Var name="CategoryLabel"$></li>
    <mt:SubCategories category="$CategoryLabel">
        <li>Child: <a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
    </mt:SubCategories>
</mt:HasParentCategory>

Exclude Empty Categories

The SubCategories tag doesn’t support the show_empty attribute that the Categories tag does, where you can choose whether or not to show categories that don’t have any entries assigned to them.

But! There’s a simple solution using MT’s conditional If tags. If the category contains entries, show the Category Label:

<mt:SubCategories>
    <mt:If tag="CategoryCount" ne="0">
        <mt:CategoryLabel>
    </mt:If>
</mt:SubCategories>

Related

SubCategoryPath

The path to the category relative to mt:BlogURL. In other words, this tag returns a string that is a concatenation of the basenames of the current category and its ancestors seprated with slashes.

Examples

For the following category hierarchy:

And the following mtml:

<mt:Categories>
    The sub-category path for <$mt:CategoryLabel$> is: <$mt:SubCategoryPath$>
</mt:Categories>

The output for the category “Baz” would be:

The sub-category path for Baz is: foo/bar/baz

This tag is provided for convenience and is the equivalent of this combination of mt:ParentCategories and mt:CategoryBasename:

<mt:ParentCategories glue="/"><$mt:CategoryBasename$></mt:ParentCategories>

SubCatIsFirst

The contents of this container tag will be displayed when the first category listed by a mt:SubCategories loop tag is reached.

<mt:SubCategories>
    <mt:SubCatIsFirst>
        <!-- do something -->
    <mt:else>
        <!-- do something else -->
    </mt:SubCatIsFirst>
</mt:SubCategories>

Use mt:SubCatIsLast for conditioning content at the end of the loop.

Examples

See mt:SubCategories loop tag for more examples.

SubCatIsLast

The contents of this container tag will be displayed when the last category listed by a mt:SubCategories loop tag is reached.

<mt:SubCategories>
    <mt:SubCatIsLast>
        <!-- do something -->
    <mt:else>
        <!-- do something else -->
    </mt:SubCatIsLast>
</mt:SubCategories>

Use mt:SubCatIsFirst for conditioning content at the beginning of the loop.

Examples

See mt:SubCategories loop tag for more examples.

block, categories, category, conditional, last

SubCatsRecurse

Recursively call the SubCategories or TopLevelCategories container with the subcategories of the category in context.

<mt:TopLevelCategories>
    <$mt:CategoryLabel$>
    <$mt:SubCatsRecurse$>
</mt:TopLevelCategories>

This tag, when placed at the end of loop controlled by one of the tags above will cause them to recursively descend into any subcategories that exist during the loop.

Attributes

max_depth

An optional attribute that specifies the maximum number of times the system should recurse. The default is infinite depth.

Examples

The following code prints out a recursive list of categories/subcategories, linking those with entries assigned to their category archive pages.

<mt:TopLevelCategories>
    <mt:SubCatIsFirst>
        <ul>
    </mt:SubCatIsFirst>
    <mt:If tag="CategoryCount">
            <li><a href="<$mt:CategoryArchiveLink$>" title="<$mt:CategoryDescription$>"><$mt:CategoryLabel$></a>
    <mt:Else>
            <li><$mt:CategoryLabel$>
    </mt:If>
    <$mt:SubCatsRecurse$>
            </li>
    <mt:SubCatIsLast>
        </ul>
    </mt:SubCatIsLast>
</mt:TopLevelCategories>

Related

SubFolderRecurse

Recursively call the <mt:SubFolders> or <mt:TopLevelFolders> container with the subfolders of the folder in context. This tag, when placed at the end of loop controlled by one of the tags above will cause them to recursively descend into any subfolders that exist during the loop.

<mt:TopLevelFolders>
    <mt:FolderLabel>
    <mt:SubFolderRecurse>
</mt:TopLevelFolders>

Because folders are essentially categories for pages, most of the Category tags also work for folders.

Attributes

max_depth

Specifies the maximum number of times the system should recurse. Default is infinite depth.

Examples

Create recursive list of folders/subfolders, linking those with pages to the respective directory.

Note: Because folders don’t have archive templates, there is no <mt:FolderArchiveLink> because there is no guarantee that a page with the basename of index exists in the folder. Thus linking to the folder must be created manually using <mt:BlogURL><mt:FolderPath>/.

<mt:TopLevelFolders>
    <mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
        <mt:If tag="FolderCount">
            <li><h3><a href="<$mt:BlogURL$><$mt:FolderPath$>/"
            title="<$mt:FolderDescription$>"><mt:FolderLabel></a>
            (<$mt:FolderCount$>)</h3>
        <mt:Else>
            <li><h3><$mt:FolderLabel$> (<$mt:FolderCount$>)</h3>
        </mt:If>
        <$mt:SubFolderRecurse$>
        </li>
    <mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>

Same as above example but now listing pages in each folder, recursively.

<mt:TopLevelFolders>
    <mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
        <mt:If tag="FolderCount">
            <li><h3><a href="<$mt:BlogURL$><$mt:FolderPath$>/"
            title="<$mt:FolderDescription$>"><mt:FolderLabel></a>
            (<$mt:FolderCount$>)</h3>
        <mt:Else>
            <li><h3><$mt:FolderLabel$> (<$mt:FolderCount$>)</h3>
        </mt:If>
        <mt:Pages>
            <mt:If name="__first__"><ul></mt:If>
                <li><a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a></li>
            <mt:If name="__last__"></ul></mt:If>
        </mt:Pages>
        <$mt:SubFolderRecurse$>
        </li>
    <mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>

SubFolders

A specialized version of the Folders container tag that respects the hierarchical structure of folders.

Attributes

include_current

An optional boolean attribute that controls the inclusion of the current folder in the list.

top

If set to 1, displays only top level folders. Same as using TopLevelFolders.

sort_by MT5.1

Specifies the sort key. The following options are available. This attribute was introduced in Movable Type 5.1.

The default value is user_custom. It produces the sort order you specified on the Manage Folders screen.

This attribute is ignored if sort_method has been set.

Display a reversed list of top-level folders sorted by the label:

<mt:SubFolders top="1" sort_by="label" sort_order="descend">
  <!-- do something -->
</mt:SubFolders>    

sort_order

Specifies the sort order. Values "ascend" (default) and "descend".

sort_method

An optional and advanced usage attribute. A fully qualified Perl method name to be used to sort the folders.

Examples

The following code lists folders and pages hierarchically.

<mt:TopLevelFolders>
    <mt:SubCatIsFirst><ul></mt:SubCatIsFirst>
    <mt:If tag="FolderCount">
        <li><$mt:FolderLabel$> (<$mt:FolderCount$>)
             <mt:Pages sort_by="title" sort_order="ascend">
                <mt:PagesHeader>
                  <ul>
                </mt:PagesHeader>
                <li class="page page-<$mt:PageID$>"><a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a></li>
                <mt:PagesFooter>
                </ul>
                </mt:PagesFooter>
              </mt:Pages>
    <mt:Else>
        <li><$mt:FolderLabel$>
    </mt:If>
    <$mt:SubCatsRecurse$>
        </li>
    <mt:SubCatIsLast></ul></mt:SubCatIsLast>
</mt:TopLevelFolders>

SupportDirectoryURL

Outputs the URL of the support directory.

Modifiers

with_domain (New in MT6)

By default, the tag outputs a relative URL like /path/to/support/directory. If with_domain is set to 1, the tag outputs a full URL starting with http:// or https://.

<$mt:SupportDirectoryURL with_domain="1"$>

T

TagCount

Returns the number of entries that have been tagged with the current tag in context.

TagID

Outputs the numeric ID of the tag currently in context.

TagLabel

An alias for the 'TagName' tag.

TagName

Outputs the name of the current tag in context.

Attributes:

TagRank

A variable tag which returns a number from “1” to “6” (by default) which represents the rating of the entry tag in context in terms of usage where “1” is used for the most often used tags, “6” for the least often. The tag context is created by either an EntryTags or an Tags block.

This is suitable for creating “tag clouds” in which TagRank can determine what level of header (h1-h6) to apply to the tag.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Example

The following is a very basic tag cloud suitable for an index template or, with some styling, a sidebar of any page.

<h1>Tag cloud</h1>
<div id="tagcloud">
    <mt:Tags>
        <h<mt:TagRank>>
            <a href="<mt:TagSearchLink>"><mt:TagName></a>
        </h<mt:TagRank>>
    </mt:Tags>
</div>

Note that the results are not always as expected. If few tags are used frequently you may end up with many h1, h2, and h3 elements, no h4 or h5, and only one h6, for example. Or, if your tags have very little re-use, you may end up with a single h1 and many h6 elements, with nothing in between. That’s part of the excitement: to see how your tags are distributed!

Tags

A container tag used for listing all previously assigned entry tags for the blog in context.

Attributes

The following code is functional on any template. It prints a simple list of tags for a blog, each linked to a tag search.

<ul>
    <mt:Tags>
    <li>
        <a href="<mt:TagSearchLink>"><mt:TagName></a>
    </li>
    </mt:Tags>
</ul>

Using tags like TagRank and TagCount and proper page styling, you can make this simple code into a powerful looking and useful “tag cloud”.

<ul>
    <mt:Tags top="20">
    <li class="rank-<mt:TagRank max="10"> widget-list-item">
        <a href="<mt:TagSearchLink>"><mt:TagName></a>
    </li>
    </mt:Tags>
</ul>

TagSearchLink

A variable tag that outputs a link to a tag search for the entry tag in context. The tag context is created by either an EntryTags or a Tags block.

Like all variable tags, you can apply any of the supported global tag modifiers to TagSearchLink to do further transformations.

Examples

The example below shows a tag cloud where each tag is linked to a search for other entries with that tag assigned. It can just as easily be used to link entry tags within an EntryTags loop.

    <h1>Tag cloud</h1>
    <div id="tagcloud">
        <mt:Tags>
            <h<$mt:TagRank$>>
                <a href="<$mt:TagSearchLink$>"><$mt:TagName$></a>
            </h<$mt:TagRank$>>
        </mt:Tags>
    </div>

The search link will look something like:

http://example.com/mt/mt-search.cgi?blog_id=1&tag=politics

Using Apache rewriting, the search URL can be cleaned up to look something like:

http://example.com/tag/politics

A URL like this would have to be built like this:

<mt:EntryTags glue=", ">
    <mt:BlogURL>tag/<mt:TagName normalize="1">
</mt:EntryTags>

And of course, you would have to create the .htaccess rules to translate this into a request to mt-search.cgi:

RewriteEngine On
RewriteRule ^tag/(.*)$ /mt/search.cgi?blog_id=1&tag=$2&limit=20 [L]

Template Tags by Type

There are many different types of template tags in Movable Type, and each type describes a different kind of information that you might want to publish on your site. Here, we’ve grouped almost all of the available tags into a small number of types so that you can find them based on the kind of information you’d like to display.


There’s a full alphabetical list of tags, as well.

Archives: Archive tags let you output lists of archives, create links to them, and provide titles and other information about archive listings.

Assets: You can publish any asset in Movable Type’s asset management system using asset template tags, along with the asset’s score, any tags describing the asset, and metadata like its title, description, and size.

Authors: There are template tags to output all information about authors on your system, either in a system-wide context or for publishing information about the author of an individual entry or page.

Websites: Websites template tags offer fundamental information about your website’s configuration, and some options for multi-blog aggregation. ( Movable Type 5 )

Blogs: Blog template tags offer fundamental information about your blog’s configuration, and some options for multi-blog aggregation.

Calendars: If you’d like to include a calendar-style listing of your blog content, calendar template tags will do the trick.

Categories: Category template tags are handy both for publishing lists of categories that you use on your site as well as outputting information about the categories that an individual entry belongs to.

Comments and TrackBacks: All of the feedback on your site can be published using comment and TrackBack tags, along with conditional tags to change what’s published depending on your comment settings.

Counts: There are lots of different items in MT that you might want to count and display on your blog — assets, entries, pages and more. Counting template tags let you do exactly that.

Creative Commons: Movable Type was the first platform to integrate Creative Commons license options right into the tool, and the CC template tags let you publish machine-readable versions of those licenses on your site.

Date and Time: Movable Type manages many dates and times, for events such as when your content is created or updated, and these can all be published using date and time template tags.

Entries: Entries are the heart of MT’s publishing system, so there are lots and lots of template tags for outputting every single aspect of entries, along with their associated data and information like categories and tags.

Feeds: Feeds are a mysterious mistress — best not to tread where these template tags will lead you!

Folders: MT’s folder management system works hand-in-hand with its asset management, and folder tags let you link to folders and display information about them.

IDs: Every object in Movable Type, from entries to authors to assets, has its own unique system ID, generated by your database. You can do fancy tricks with these IDs, or just use them to reference objects, all by using ID template tags.

Logic: Get yer Spock on with logic template tags — all of the ifs, thens, elses, unlesses, and fors you need to do some serious programming-style templates. Logic tags also let you set up parts of your template that publish based on the content or settings of your blog.

Pages: Just like with entries, pages form the heart of what you can publish with MT, and the pages template tags provide access to all the information that makes up a page.

Search: Search template tags are perfect for customizing your search results to appear exactly the way you want them to.

Tags: This might seem a little tricky — you can use template tags to publish the Tags you use on your entries and pages. Don’t worry, you’ll get the hang of it. And you can even do fancy stuff like tag clouds.

App: App template tags are used by the MT administration screens. You probably won’t need (or want!) to mess with these unless you’re customizing the application itself.

System: System template tags offer some insights into broad, system-wide settings for your MT install. A few of these are handy for setting defaults in your published templates, or for outputting the location of the various scripts that make your MT install run.

Archives

Assets

Authors

Websites (Movable Type 5)

Blogs

Calendars

Categories

Comments and TrackBacks

Counts

Creative Commons

Custom Fields

Date and Time

Entries

Feeds

Folders

IDs

Logic Tags (If/Then/Else)

Pages

Tags

Themes (Movable Type 5)

Variables

App

System

TemplateCreatedOn

Returns the creation date for the template publishing the current file.

Example:

    <$mt:TemplateCreatedOn$>

TemplateCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

TemplateCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

TemplateCustomFields

This container tag iterates, or loops, over all custom fields associated with a template.

See mt:EntryCustomFields for more details.

<mt:TemplateCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:TemplateCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:TemplateCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:TemplateCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:TemplateCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:TemplateCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

TemplateCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

TemplateNote

A function tag that always returns an empty string. This tag is useful for placing simple notes in your templates, since it produces nothing.

Example:

    <$mt:TemplateNote note="Hi, mom!"$>

Textile

Type: block

Example

<mt:Textile>
  <!-- do something -->
</mt:Textile>

TextileHeadOffset

Type: function

Provides a way to offset the .h1, .h2, etc. Textile header blocks. This is useful if you always write your entries using "h1.", "h2." blocks, but need these to be published with "<h3>", "<h4>" tags instead (depending on the structure of the document being published).

Attributes

Example

<$mt:TextileHeadOffset offset="2"$>

TextileOptions

Type: function

Example

<mt:TextileOptions />

TopLevelCategories

A block tag listing the categories which exist at “the top” of the category hierarchy; categories which do not have a parent category.

<mt:TopLevelCategories>
    <mt:CategoryLabel>
</mt:TopLevelCategories>

Same as using <mt:SubCategories top="1">.

See mt:SubCategories for details.

TopLevelFolder

A container tag that creates a context to the top-level ancestor of the current folder.

TopLevelFolders

A block tag listing the folders that do not have a parent and exist at “the top” of the folder hierarchy. Same as using <mt:SubFolders top="1">.

Examples

Basic listing of the top level folders:

<mt:TopLevelFolders>
    <!-- do something -->
    <$mt:FolderLabel$>
</mt:TopLevelFolders>

See more examples in the <$mt:SubFolderRecurse$> tag docs.

Related

TopLevelParent

A container tag that creates a context to the top-level ancestor of the current category.

TotalPages

A function tag returns a number represents the total number of pages in the current search context. The number starts from 1.

TrackbackScript

Returns the value of the TrackbackScript configuration setting. The default for this setting if unassigned is "mt-tb.cgi".

TypeKeyToken

Outputs the configured TypeKey token for the current blog in context. If the blog has not been configured to use TypeKey, this will output an empty string.

U

Unless

A conditional tag that is the logical opposite of the If tag. All attributes supported by the If tag are also supported for this tag.

UserSessionCookieDomain

Returns the value of the UserSessionCookieDomain configuration setting, or the domain name of the blog currently in context. Any "www" subdomain will be ignored (ie, "www.sixapart.com" becomes ".sixapart.com").

The UserSessionCookieDomain may also use MT tags. If it does, they will be evaluated for the blog in context.

UserSessionCookieName

Returns the value of the UserSessionCookieName configuration setting. If the setting contains the %b string, it will replaced with the blog ID of the blog currently in context.

Example:

    <$mt:UserSessionCookieName$>

UserSessionCookiePath

Returns the value of the UserSessionCookiePath configuration setting.

The UserSessionCookiePath may also use MT tags. If it does, they will be evaluated for the blog in context.

UserSessionCookieTimeout

Returns the value of the UserSessionCookieTimeout configuration setting.

UserSessionState

Returns a JSON-formatted data structure that represents the user that is currently logged in.

This tag is usually only used in the context of system templates. The blog accesses this data once per user session via javascript. See the JavaScript index template from the default template set for an example of this.

Example

The tag <$mt:UserSessionState$> will output the following JSON data structure (formatted with whitespace for readability):

{
    "sid":"Hk8lPRoJ1FBuxnQrdZUUvC8qHo9ngmgyNDEKLIkW",
    "userpic":"/mt-static/support/assets_c/userpics/userpic-1-100x100.png",
    "profile":"",
    "auth_type":1,
    "is_trusted":1,
    "is_anonymous":0,
    "name":"Melody P Nelson",
    "email":"melody@sixapart.com",
    "is_author":1,
    "is_banned":0,
    "is_authenticated":1,
    "can_comment":1,
    "can_post":1,
    "url":"http://sixapart.com"
}

V

Var

A function tag used to store (like the <mt:SetVar>) and return values from variables.

This tag is one of the most useful tags when digging deeper into creating templates with Movable Type.

Basic Example

  1. Set a variable (no output when setting the value of a variable):

    <$mt:Var name="foo" value="bar"$>
    
  2. later in the code, output the value of the variable:

    <$mt:Var name="foo"$>
    

    Output:

    bar
    

Tip: Use the <mt:SetVarBlock> tag to store the output of a set of template tags in a variable:

<mt:SetVarBlock name="entry_ids">
  <mt:Entries glue=","><$mt:EntryID$></mt:Entries>
</mt:SetVarBlock>

Variables as attribute values

<$mt:Var name="latest_entries" value="10"$>
The most recent <$mt:Var name="latest_entries"$> entries:
<ul>
<mt:Entries lastn="$latest_entries">
    <li><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li>
</mt:Entries>
<ul>

Tip: Use the setvar modifier to set the value of a variable rather than output the value:

<$mt:BlogID setvar="foo"$>

Attributes

Note: Support for various attributes depends on the version of Movable Type.

The most common attributes are in bold.

append

Used to append a value to the end of an existing variable. Opposite of prepend.

Values 1 and 0 (default).

<$mt:Var name="foo" value="bar"$>
<$mt:Var name="foo" value="baz" append="1"$>
<$mt:Var name="foo"$>

Output:

barbaz

default

A value returned when the variable’s value is a empty string or not defined.

<$mt:Var name="foo" default="bar"$>

A value of “0” does not trigger the default attribute. Use a conditional such as <mt:If> or <mt:Unless> tag instead:

<$mt:Var name="foo" value="0"$>
<mt:If name="foo">
    foo is a non-zero value.
<mt:Else>
    foo is zero or another empty string.
</mt:If>

function

The function attribute supports diffent values for array and hash variables.

For array variables:

For hash variables:

See examples for array and hash variables below.

name

Required attribute identifying the template variable to be assigned or displayed.

The name attribute value should be a string made up of only alphanumeric characters and underscores (“_”) in order to not conflict with variable interpolation. Curly brackets (“{ }” may be used for specifying hash values see <mt:SetHashVar>).

It’s best practice to keep variable names as simple, short and memorable as possible. (Note: prior to Movable Type 4, variable names were less constrained, but invalid characters such as spaces and symbols in particular are unsupported.)

Template variables may also be arrays or hash variables, in which case you may want to reference a specific element instead of the array or hash itself.

This selects the second element from the ‘foo’ array variable:

<$mt:Var name="foo[1]"$>

This selects the ‘bar’ element from the ‘foo’ hash variable:

<$mt:Var name="foo{bar}"$>

Sometimes you want to obtain the value of a function that is applied to a variable (see the function attribute). This will obtain the number of elements in the ‘foo’ array variable:

<$mt:Var name="count(foo)"$>

op

Allows the application of a number of mathematical operators to the value of the variable.

Note: when using the op attribute, the value attribute is used to define the second operand instead of to set the value of the variable. If the calculated value of the operation needs to be stored, use the setvar attribute.

Examples:

<$mt:Var name="days" value="10"$> (set the value of the variable using "value". The [`<mt:SetVar>`](/tags/setvar) tag could also be used here.)
<$mt:Var name="days"$> ($days = 10)
<$mt:Var name="days" op="/" value="2"$> ($days divide by 2 = 5)
<$mt:Var name="days" op="*" value="3" setvar="days_multiplied_by_three"$> ($days multiplied by 3 = 30 stored in a new variable using "setvar")
<$mt:Var name="days_multiplied_by_three"$> ($days_multiplied_by_three = 30)
<$mt:Var name="days" op="+" value="1" setvar="days"$> ($days plus 1 = 11 used to update the value of the "days" variable using "setvar")
<$mt:Var name="days" op="%" value="3"$> (remainder of $days divided by 3 = 2)
<$mt:Var name="days" op="++"$> ($days plus 1 = 12)

Output

 (set the var)
10 (output = 10)
5 (output = 5)
 (output of 30 used to set the valuable of a new variable)
30 (output = 30)
 (output of 11 used to update the value of the "days" variable)
2 (output = 2)
12 (output = 12)

See the <mt:If> tag for supported values for the op attribute and operations examples on the wiki.

prepend

Used to add a value to the beginning of an existing variable. Opposite of append.

Values 1 and 0 (default).

<$mt:Var name="foo" value="bar"$>
<$mt:Var name="foo" value="baz" prepend="1"$>
<$mt:Var name="foo"$>

Output:

bazbar

value

Causes the variable to be assigned the value specified. In this way, this tag is useful for setting variables instead of using <$mt:SetVar$>, <mt:SetVars>, or <mt:SetVarBlock>.

The following are equivalent, they all set the the value of the variable “foo” to “bar”:

<$mt:Var name="foo" value="bar"$>
<$mt:SetVar name="foo" value="bar"$>
<mt:SetVarBlock name="foo">bar</mt:SetVarBlock>

The value can contain anything other than a double quote. If the value is long or contains a double quote, use <mt:SetVarBlock> instead.

If provided with the op attribute, value provides the operand for the specified mathematical operation.

Six Apart has four offices, added four different ways as values of the “offices” array. Then output using the <mt:Loop> tag:

<$mt:SetVar name="offices[0]" value="San Francisco"$>
<$mt:SetVar name="unshift(offices)" value="Tokyo"$>
<mt:SetVarBlock name="offices[2]">Paris</mt:SetVarBlock>
<$mt:SetVar name="offices" index="3" value="New York"$>
<mt:Loop name="offices" glue=", "><$mt:Var name="__value__"$></mt:Loop>

var

Alias of name.

Examples

Variables with Operator

This example outputs the count of entries in the loop which have the tag specified; in this case the tag is set to “Foo”. The variable “tag_count” is initialized and then in the loop, if the entry is tagged with the value of “tag_label”, then the “tag_count” variable is incremented. Finally the “tag_count” variable is output if it is a non-zero or non-empty value.

<$mt:Var name="tag_label" value="Foo"$>
<$mt:Var name="tag_count" value="0"$>
<ul>
<mt:Entries>
    <li>
        <$mt:EntryTitle$>
    <mt:EntryIfTagged tag="$tag_label">
        is tagged "<$mt:Var name="tag_label"$>"
        <$mt:Var name="tag_count" op="++" setvar="tag_count"$>
    </mt:EntryIfTagged>
    <mt:If tag="EntryTags">
        (tags: <mt:EntryTags glue=", "><$mt:TagLabel$></mt:EntryTags>)
    </mt:If>
    </li>
</mt:Entries>
</ul>
<mt:If name="tag_count">
    <p>On this page there are <$mt:Var name="tag_count"$> entries tagged "<$mt:Var name="tag_label"$>".</p>
</mt:If>

Array Variables

Add items to an array “sandwich”:

<$mt:Var name="sandwich" index="0" value="bagel"$>
<$mt:Var name="sandwich" index="1" value="cream cheese"$>
<$mt:Var name="sandwich" index="2" value="lox"$>

An alternate syntax, just for reference:

<$mt:Var name="sandwich[1]" value="bagel"$>
<$mt:Var name="sandwich[2]" value="cream cheese"$>
<$mt:Var name="sandwich[3]" value="lox"$>

Let’s take an item off the end of the array and then add a new to the end of the array:

<$mt:Var name="sandwich" function="pop" setvar="removed_ingredient"$>
<$mt:Var name="sandwich" function="push" value="tomato"$>

Output them glued with comma and space. Then is concatenated with a period using the cat modifier.

The sandwich has <$mt:Var name="count(sandwich)"$> ingredients: <$mt:Var glue=", " cat="." name="sandwich"$> The removed item is: <$mt:Var name="removed_ingredient"$>.

Final output:

The sandwich has 3 ingredients: bagel, cream cheese, tomato. The removed item is: lox.

The ingredients can also be output using the <mt:Loop> tag with template loop meta variables:

<mt:Loop name="sandwich">
    <li><$mt:Var name="__value__"$></li>
</mt:Loop>

Hash Variables

Loop through the last 20 entries and list each author once (skip if already found), limit to 4. This code assumes that there will be at least 4 unique bloggers in the last 20 entries. If not increase the lastn value.

<$mt:Var name="author_limit" value="4"$>
<$mt:Var name="author_count" value="0"$>
<mt:Entries lastn="20">
    <mt:EntriesHeader>
<h2>Recent Bloggers</h2>
<ul>
    </mt:EntriesHeader>
    <mt:If name="author_count" lt="$author_limit">
        <$mt:EntryAuthorID setvar="current_author_id"$>
        <mt:Unless name="recent_bloggers{$current_author_id}">
            <li>
                <$mt:EntryAuthorDisplayName encode_html="1"$><br />
                <a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
            </li>
            <$mt:SetVar name="author_count" op="++"$>
            <$mt:SetVar name="recent_bloggers{$current_author_id}" value="1"$>
        </mt:Unless>
    </mt:If>
    <mt:EntriesFooter>
</ul>
    </mt:EntriesFooter>
</mt:Entries>

Loop though the blogs in the install and ouput an additional message for blog with the id of 1:

<mt:SetVarBlock name="BlogExtras{1}">
    This the blog with the ID of 1
</mt:SetVarBlock>
<mt:Blogs>
    <$mt:BlogID setvar="BlogID"$>
    <div>
        <a href="<$mt:BlogURL$>"><$mt:BlogName$></a>
        <mt:If name="BlogExtras{$BlogID}">
            <$mt:Var name="BlogExtras{$BlogID}"$>
        </mt:If>
    </div>
</mt:Blogs>

Related

Version

The version number of the Movable Type system.

Example:

    <mt:Version />

VideoCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

VideoCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

VideoCustomFields

This container tag iterates, or loops, over all custom fields associated with a video type asset.

See mt:EntryCustomFields for more details.

<mt:VideoCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:VideoCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:VideoCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:VideoCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:VideoCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:VideoCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

VideoCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

W

WebsiteCCLicenseImage

Publishes the URL of the Creative Commons logo appropriate to the license assigned to the website in context. If the website doesn't have a Creative Commons license, this tag returns an empty string.

WebsiteCCLicenseURL

Publishes the license URL of the Creative Commons logo appropriate to the license assigned to the website in context. If the website doesn't have a Creative Commons license, this tag returns an empty string.

WebsiteCommentCount

Returns the number of published Comments associated with the Website currently in context.

Attributes

*top

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:WebsiteCommentCount singular="1 comment">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:WebsiteCommentCount plural="# comments">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:WebsiteCommentCount none="No comments">

or

<mt:WebsiteCommentCount none="None">

top

if specified, gets a count of comments that do not contain a reply.

Example

This returns

"1 comment" or "9 comments" or "No comment".

WebsiteCustomFieldDescription

Displays the description for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldDescription. See EntryCustomFields for more info.

WebsiteCustomFieldName

Displays the name or “label” for the custom field in context.

Recommended alternative: This tag an alias of mt:CustomFieldName. See EntryCustomFields for more info.

WebsiteCustomFields

This container tag iterates, or loops, over all custom fields associated with a website.

See mt:EntryCustomFields for more details.

<mt:WebsiteCustomFields>
  <ul>
    <mt:IfNonEmpty tag="CustomFieldValue">
    <li><$mt:CustomFieldName$>: <$mt:CustomFieldValue$></li>
    </mt:IfNonEmpty>
  </ul>
</mt:WebsiteCustomFields>

Filter the list of fields using the include or exclude attributes.

Modifiers

include

Value is the name of the custom fields you wish to include from the loop:

<mt:WebsiteCustomFields include="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:WebsiteCustomFields>

exclude

Value is the name of the custom fields you wish to exclude from the loop:

<mt:WebsiteCustomFields exclude="Foo Field, Bar Field">
    <$mt:CustomFieldName$>
</mt:WebsiteCustomFields>

Display custom field data

The following MTML code will loop through every custom field and output the function tags:

The following tags are more specific aliases of the more generic tags in the above example:

WebsiteCustomFieldValue

Displays the value of the current custom field for the object in context.

Recommended alternative: This tag an alias of mt:CustomFieldValue. See EntryCustomFields for more info.

WebsiteDateLanguage

The website's specified language for date display. This setting can be changed on the website's settings screen.

Attributes:

This tag has been available since Mvable Type 5.2.6.

WebsiteDescription

Outputs the description field of the website currently in context.

<$mt:WebsiteDescription$>

WebsiteEntryCount

Used to display the number of published website entries. This does not include child blog entries by default.

Modifiers

All modifiers are optional.

MultiBlog modifiers

include_with_website

If set to 1, counts the parent website’s entries in addition to any child blogs being counted due to MultiBlog modifiers.

singular

Sets text to output when there is exactly one entry.

plural

Sets text to output when there is more than one entry. If # is included in the text, it will be automatically replaced with the number of entries.

none

Sets text to output when there are no entries.

WebsiteFileExtension

Returns the configured website filename extension, including a leading '.' character. If no extension is assigned, this returns an empty string.

WebsiteHasBlog

A conditional tag that returns True when the current website in the context has one or more blogs.

An else tag can be used with this tags.

WebsiteHost

The host name part of the absolute URL of your website.

Attributes:

WebsiteID

Outputs the numeric ID of the website currently in context.

WebsiteIfCCLicense

A conditional tag that is true when the current website in context has been assigned a Creative Commons License.

Example

<mt:WebsiteIfCCLicense>
    Our Creative Commons license: <mt:WebsiteCCLicenseURL>
    <div><img src="<mt:WebsiteCCLicenseImage>" /></div>
<mt:Else>
    We have not yet selected a Creative Commons license for our website.
</mt:WebsiteIfCCLicense>

WebsiteIfCommentsOpen

A conditional tag that returns true when: the system is configured to allow comments and the website is configured to accept comments in some fashion.

Example

<mt:WebsiteIfCommentsOpen>
<!-- do something -->
</mt:WebsiteIfCommentsOpen>

WebsiteLanguage

This template tag will return the website’s specified language for date display. This setting can be changed on the website’s settings screen.

Attributes

Example

<mt:WebsiteLanguage locale="1">

will return

en_US

(assuming “English” was chosen in the Website’s Language field in the Settings screen)

WebsiteName

Outputs the name of the website currently in context.

 <$mt:WebsiteName$>

WebsitePageCount

Returns the number of published Pages associated with the Website currently in context.

Attributes

MultiBlog Attributes

This template tag supports the multiblog template tags.

Count Attributes

singular

Allows special formatting for when the number of published objects is equal to 1.

<mt:WebsitePageCount singular="1 page">

plural

Allows special formatting for when the number of published objects is greater than 1. # is automatically replaced with the number of objects.

<mt:WebsitePageCount plural="# pages">

none

Allows special formatting for when the number of published objects is 0 (zero).

<mt:WebsitePageCount none="No pages">

or

<mt:WebsitePageCount none="None">

Example

This returns

"1 page" or "9 pages" or "No page".

WebsitePath

Outputs the Site Root field of the website currently in context. An ending '/' character is guaranteed.

WebsitePingCount

The number of published TrackBack pings in the website. This template tag supports the multiblog template tags.

Example

<$mt:WebsitePingCount singular="1 trackback" plural="# trackbacks" none="No trackback"$>

This returns

"1 trackback" or "9 trackbacks" or "No trackback".

WebsiteRelativeURL

Outputs the Site URL field of the website currently in context. If the website has the Site URL "http://www.example.com/first-website/" , this tag returns "/first-weblog/"

Websites

A container tag which iterates over a list of all of the websites in the system.

Attributes

Example

<ul>
<mt:Websites site_ids="all">
    <li>
        <a href="<mt:WebsiteURL>">
            <mt:WebsiteName>
        </a>
        <span class="count">
            <mt:WebsitePageCount singular="1 page" plural="# pages">
        </span>
    </li>
</mt:Websites>
</ul>

WebsiteThemeID

Outputs the ID of the theme currently applied to the website in context. The identifier is modified such that underscores are changed to dashes.

Modifiers

WebsiteTimezone

The timezone that has been specified for the website displayed as an offset from UTC in +|-hh:mm format. This setting can be changed on the blog's General settings screen.

Attributes:

If specified, will produce the timezone without the ":" character ("+|-hhmm" only).

WebsiteURL

Outputs the Site URL field of the website currently in context. An ending '/' character is guaranteed.

WidgetManager

An alias for the WidgetSet tag, and considered deprecated.

WidgetSet

Publishes the widget set identified by the name attribute.

Modifiers

X

XMLRPCScript

Returns the value of the XMLRPCScript configuration setting. The default for this setting if unassigned is "mt-xmlrpc.cgi".