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:
author_id, the numeric author ID of the author whose action it iscreated_on, the date and time when the action occurred or was first foundmodified_on, the date and time when the action last changedYou 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>
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.domain.com/cgi-bin/mt/
Or:
/cgi-bin/mt/
Default use of:
<$mt:AdminCGIPath$>
Will output:
http://www.domain.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.
Output will be a full url to the directory where the Movable Type CGI scripts exist.
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>
Returns the value of the AdminScript configuration directive.
Default use of:
<$mt:AdminScript$>
Will output:
mt.cgi
The default value (if unspecified by the AdminScript config directive in mt-config.cgi) is mt.cgi
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>
Produces markup for application templates for the strip of actions for a application listing or edit screen.
Attributes:
Assigns a CSS class name indicating whether the control is above or below the listing or edit form it is associated with.
Assign either 1 or 0 to control whether the pagination controls are displayed or not.
Associates the pagition controls and item action widget with the given form element.
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:
Identifies the URL to submit the form to. If not given, will use the current application URI.
Supplies the form method.
"GET" or "POST" are the typical values for this,
but will accept any HTTP-compatible method (ie: "PUT",
"DELETE").
Populates a hidden 'id' field in the form. If not given, will also use any 'id' template variable defined.
Populates a hidden 'blog_id' field in the form. If not given, will also use any 'blog_id' template variable defined.
Populates a hidden '_type' field in the form. If not given, will also use any 'type' template variable defined.
Used to form the 'id' element of the HTML form tag.
If not specified,
the form tag 'id' element will be assigned TYPE-form,
where TYPE is the determined object_type.
Supplies the form name attribute.
If unspecified,
will use the id attribute,
if available.
If assigned,
sets an 'enctype' attribute on the form tag using the value supplied.
This is typically used to create a form that is capable of uploading files.
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>
Produces a application link to the current script with the mode and attributes specified.
Attributes:
Maps to a '__mode' argument.
Maps to a '_type' argument.
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.
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$>
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:
The MT::Object object type the listing is processing. If unset, will use the contents of the object_type variable.
The source of data to process. This is an array of hashes, similar to the kind used with the Loop tag. If unset, the object_loop variable is used instead.
Used when there are no rows to output for the listing. If not set, it will process any 'else' block that is available instead, or, failing that, will output an App:StatusMsg tag saying that no data could be found.
Used to construct the DOM id for the listing. The outer div tag will use this value. If unset, it will be assigned type-listing (where 'type' is the object type determined for the listing; see 'type' attribute).
Provides a custom class name that can be applied to the main div tag produced (this is in addition to the 'listing' class that is always applied).
Supplies the 'action' attribute of the form tag produced.
Controls whether the pagination controls are shown or not. If unspecified, pagination is shown.
Controls whether the actions associated with the object type processed are shown or not. If unspecified, actions are shown.
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$>
An application template tag used to display an application form field.
Attributes:
Each application setting tag requires a unique 'id' attribute. This id should not be re-used within the template.
Controls whether the field is displayed with visual cues that the field is a required field or not.
Supplies the label phrase for the setting.
Controls whether the label portion of the setting is shown or not.
Controls whether the setting is visible or not.
If specified,
adds a "hidden" class to the outermost div tag produced for the setting.
Allows an additional CSS class to be applied to the label of the setting.
Allows an addtional CSS class to be applied to the contents of the setting.
Supplies a "hint" phrase that provides inline instruction to the user. By default, this hint is hidden, unless the 'show_hint' attribute forces it to display.
Controls whether the inline help 'hint' label is shown or not.
Supplies a warning message to the user regarding the use of this setting.
Controls whether the warning message is shown or not.
Identifies a specific page of the MT help documentation for this setting.
Identifies a section name of the MT help documentation for this setting.
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>
An application template tag used to wrap a number of App:Setting tags.
Attributes:
A unique identifier for this group of settings.
If specified,
applies this CSS class to the fieldset tag produced.
Controls whether the fieldset is initially shown or not.
If hidden,
a CSS "hidden" class is applied to the fieldset tag.
Example:
<MTApp:SettingGroup id="foo">
<MTApp:Setting ...>
<MTApp:Setting ...>
<MTApp:Setting ...>
</MTApp:SettingGroup>
An application template tag that outputs a MT status message.
Attributes:
Accepted values: "all", "index".
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:
If specified,
will be used as the 'id' attribute for the outermost div tag for the widget.
If unspecified,
will use the 'widget_id' template variable instead.
The label to display above the widget.
If specified, this link will wrap the label for the widget.
If specified, this JavaScript code will be assigned to the 'onclick' attribute of a link tag wrapping the widget label.
If unspecified,
will use the id of the widget.
This class is included in the 'class' attribute of the outermost div tag for the widget.
Identifies whether widget may be closed or not.
If specified, the widget will be assigned an attribute that gives it a tabbed interface.
Example:
<mtapp:Widget class="widget my-widget"
label="<__trans phrase="All About Me">" can_close="1">
(contents of widget go here)
</mtapp:Widget>
This tag 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.
Example:
<mt:Categories>
There are <$mt:ArchiveCount$> entries in the <$mt:CategoryLabel$>
category.
</mt:Categories>
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.
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:
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). See the Date tag for the supported formats.
Forces the date to the format associated with the specified language.
Forces the date to UTC time zone.
Produces a relative date (relative to current date and time). Suitable for dynamic publishing (for instance, from PHP or search result templates). If a relative date cannot be produced (the archive date is sufficiently old), the 'format' attribute will govern the output of the date.
Example:
<$mt:ArchiveDateEnd$>
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:
set to '0' to exclude the file extension (ie, produce "politics" instead of "politics.html")
set to '-' to force any underscore characters in the filename to dashes
Example:
<$mt:ArchiveFile$>
An alias for the ArchiveTypeLabel tag.
Notes:
Deprecated in favor of the more specific tag: ArchiveTypeLabel
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:
Identifies the specific archive type to generate a link for. If unspecified, uses the current archive type in context, when publishing an archive template.
If specified, forces any index filename to be included in the link to the archive page.
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).
<$MTArchiveLink type="Monthly"$>
A container tag representing a list of all the archive pages of a certain type.
Attributes:
An optional attribute that specifies the type of archives to list. Recognized values are "Yearly", "Monthly", "Weekly", "Daily", "Individual", "Author", "Author-Yearly", "Author-Monthly", "Author-Weekly", "Author-Daily", "Category", "Category-Yearly", "Category-Monthly", "Category-Weekly" and "Category-Daily" (and perhaps others, if custom archive types are provided through third-party plugins). The default is to list the Preferred Archive Type specified in the blog settings.
An optional attribute that can be used to limit the number of archives in the list.
An optional attribute that specifies the sort order of the archives in the list. It is effective within any of the date-based and "Individual" archive types. Recognized values are "ascend" and "descend".
NOTE: 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 this:
<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>
The contents of this container tag will be displayed when the last entry listed by a ArchiveList tag is reached.
The contents of this container tag will be displayed when the first entry listed by a ArchiveList tag is reached.
A container tag that creates a context to the "next" archive relative to the current archive context.
This tag also works with the else tag to produce content if there is no "next" archive.
Attributes:
Specifies the "next" archive type the context is for. See the ArchiveList tag for supported values for this attribute.
Example:
<mt:ArchiveNext>
<a href="<$mt:ArchiveLink$>"
title="<$mt:ArchiveTitle escape="html"$>">Next</a>
<mt:Else>
<!-- output when no next archive is available -->
</mt:ArchiveNext>
A container tag that creates a context to the "previous" archive relative to the current archive context.
This tag also works with the else tag to produce content if there is no "previous" archive.
Attributes:
Specifies the "previous" archive type the context is for. See the ArchiveList tag for supported values for this attribute.
Example:
<mt:ArchivePrevious>
<a href="<$mt:ArchiveLink$>"
title="<$mt:ArchiveTitle escape="html"$>">Next</a>
<mt:Else>
<!-- output when no previous archive is available -->
</mt:ArchivePrevious>
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:
Specify a comma-delimited list of archive types to loop over. If you only wish to publish a list of Individual and Category archives, you can specify:
<mt:ArchiveList type="Individual,Category">
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).
A descriptive title of the current archive. The value returned from this tag will vary based on the archive type:
The label of the category.
The date in "Month, Day YYYY" form.
The range of dates in the week in "Month, Day YYYY - Month, Day YYYY"
The range of dates in the week in "Month YYYY" form.
The title of the entry.
Example:
<$mt:ArchiveTitle$>
Publishes the identifier for the current archive type. Typically, one of "Daily", "Weekly", "Monthly", "Yearly", "Category", "Individual", "Page", etc.
A 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
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
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:
The unique numeric id of the asset.
Example:
<mt:Asset id="10">
<$mt:AssetLabel$>
</mt:Asset>
Display name (or username if display name isn't assigned) of the user who added the asset to the system.
Example:
<$mt:AssetAddedBy$>
Returns the number of assets associated with the active blog.
Attributes:
Allows for filtering by file type. Built-in types supported are "image", "audio", "video". These types can be extended by plugins.
Example:
Images available: <$mt:AssetCount type="image"$>
The date the asset in context was added to Movable Type.
Attributes:
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). See the Date tag for the supported formats.
Forces the date to the format associated with the specified language.
Forces the date to UTC format.
Example:
<$mt:AssetDateAdded$>
This tag returns the description text of the asset currently in context.
Example:
<$mt:AssetDescription$>
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$>
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$>
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$>
A numeric system ID of the Asset currently in context.
Example:
<$mt:AssetID$>
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>
If present, the template tag will evaluate if the specified tag is assigned to the current asset.
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>
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>
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>
Returns the label of the asset in context. Label can be specified upon uploading a file.
Example:
<$mt:AssetLabel$>
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:
Specifies if the tag generates 'target="_blank"' attribute to the anchor tag.
Example:
<$mt:AssetLink$>
Returns MIME type of the asset in context. MIME type of a file is typically provided by web browser upon uploading.
Example:
<$mt:AssetMimeType$>
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:
Specifies what property to return from the tag. Supported attribute values:
asset's file size
asset's width (for image only; otherwise returns 0)
asset's height (for image only; otherwise returns 0)
asset's description
Used in conjunction with file_size property. Supported attribute values:
auto format depending on the size
size expressed in kilobytes
size expressed in megabytes
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:
Specify namespace for rank to be calculated. Namespace is defined by each plugin which leverages rating API.
Allows a user to specify the upper bound of the scale.
Example:
<$mt:AssetRank namespace="FiveStarRating"$>
A container tag which iterates (loops) over a list of assets from one or more blogs.
<mt:Assets>
<!-- tags here -->
</mt:Assets>
This container tag may contain any Asset function template tags.
Similarly, the mt:EntryAssets and mt:PageAssets tags will list all assets with the respective entry or page.
assets_per_rowThis attribute sets how many iterations the Assets tag publishes before setting the state that enables the AssetIsLastInRow AssetIsFirstInRow tags.
</mt:AssetIsLastInRow>
Supported values:
auto - which selects the most aesthetically pleasing number of items per row based on the total number of assets. For example, if you had 18 total assets, three rows of six would publish, but for 16 assets, four rows of four would publish.authorSelects assets uploaded by a single author.
Specify author’s username.
<mt:Assets author="beau">
<!-- tags here -->
</mt:Assets>
daysSelects assets created in the last number of days specified.
<mt:Assets days="3">
<!-- tags here -->
</mt:Assets>
file_extSelects assets by file extension.
Supports a comma-delimited list of file extensions.
<mt:Assets file_ext="gif, mp3, pdf">
<!-- tags here -->
</mt:Assets>
typeSelects assets by asset type.
<mt:Assets file_ext="image">
<!-- tags here -->
</mt:Assets>
Supports a comma-delimited list of asset types:
imageaudiovideofile (new in MT5)lastnLimits the selection of assets to the specified number.
<mt:Assets lastn="3">
<!-- tags here -->
</mt:Assets>
limitA positive integer to limit results.
<mt:Assets limit="3">
<!-- tags here -->
</mt:Assets>
namespaceUsed in conjunction with the sort_by attribute when sorting by “score”. The namespace identifies the method of scoring to use in sorting assets.
offsetUsed 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_bySort assets by value.
<mt:Assets sort_by="label">
<!-- asset tags -->
</mt:Assets>
Supported values:
blog_idcreated_bycreated_ondescriptionfile_extfile_namefile_pathidlabelmime_typeparentscoreurlsort_orderSupported values:
ascenddescendtagSelects assets with particular tags.
Supports expressions such as “interesting AND featured”).
<mt:Assets tag="foo AND bar">
<!-- tags here -->
</mt:Assets>
<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>
mt:EntryAssetsmt:PageAssetsA 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:
Specify namespace for score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AssetScore namespace="FiveStarRating"$>
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:
Specify namespace for avarage score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AssetScoreAvg namespace="FiveStarRating"$>
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:
Specify namespace for the number of scorings to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AssetScoreCount namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AssetScoreHigh namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AssetScoreLow namespace="FiveStarRating"$>
The contents of this container tag will be displayed when the last entry listed by a Assets tag is reached.
The contents of this container tag will be displayed when the first entry listed by a Assets tag is reached.
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:
A text string that is used to join each of the items together. For example:
<mt:AssetTags glue=", "><$mt:TagName$></mt:AssetTags>
would print out each tag name separated by a comma and a space.
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>
Produces a thumbnail image, linked to the image asset currently in context.
Attributes:
The height of the thumbnail to generate. If this is the only parameter specified then the thumbnail's width will be scaled proportionally to the height.
The width of the thumbnail to generate. If this is the only parameter specified then the thumbnail's height will be scaled proportionally to the width.
The percentage by which to reduce or increase the size of the current asset.
If set to '1', causes the link to open a new window to the linked asset.
Returns the URL for a thumbnail you wish to generate for the current asset in context.
Attributes:
The height of the thumbnail to generate. If this is the only parameter specified then the thumbnail's width will be scaled proportionally to the height.
The width of the thumbnail to generate. If this is the only parameter specified then the thumbnail's height will be scaled proportionally to the width.
The percentage by which to reduce or increase the size of the current asset.
If set to 1 (one) then the thumbnail generated will be square, where the length of each side of the square will be equal to the shortest side of the image.
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>
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$>
Produces a permalink for the uploaded asset.
Example:
<$mt:AssetURL$>
Returns the value of the AtomScript configuration setting.
The default for this setting if unassigned is "mt-atom.cgi".
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:
Identifies the requested size of the logo. This is an identifier, not a dimension in pixels. And, currently, "logo_small" is the only supported identifier.
Example:
<mt:Authors>
<img src="<$mt:AuthorAuthIconURL$>" height="16" width="16" />
<$mt:AuthorDisplayName$>
</mt:Authors>
Outputs the authentication type identifier for the author currently in context. For Movable Type registered users, this is "MT".
Outputs the 'Basename' field of the author currently in context.
Deprecated: Same as
mt:CustomFieldDescription. See EntryCustomFields for more info.
This will display the description of the current custom field in context.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
This container tag iterates, or loops, over the list of custom fields associated with an author.
See mt:EntryCustomFields for more details.
<mt:Authors>
<mt:AuthorCustomFields>
<$mt:CustomFieldName$>
</mt:AuthorCustomFields>
</mt:Authors>
Custom field name of the field you wish to exclude from the loop.
<mt:AuthorCustomFields exclude="Foo Field">
<$mt:CustomFieldName$>
</mt:AuthorCustomFields>
See mt:EntryCustomFields for more examples.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
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.
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.
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.
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>
A conditional tag that is true when the author currently in context has written one or more pages that have been published.
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.
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.
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>
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>
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:
Specify namespace for rank to be calculated. Namespace is defined by each plugin which leverages rating API.
Allows a user to specify the upper bound of the scale.
Example:
<$mt:AuthorRank namespace="FiveStarRating"$>
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>
All fields are optional.
any_typedisplay_nameidlastnlimitmin_scoremax_scoremin_ratemax_ratemin_countmax_countnamespaceneed_entryneed_associationrolerolesscoring_tosort_bysort_orderstatususernamePass 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_typeattribute of mt:Authors doesn’t work as expected
Specifies the displpay name a particular author to select.
<mt:Authors display_name="Melody Nelson">
<!-- do something -->
</mt:Authors>
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>
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>
Alias to lastn.
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.
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.
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.
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.
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.
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.
Used in conjunction with the “min_*” and “max_*” attributes to select authors based on a particular scoring mechanism.
Boolean identifer 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>
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 includeblogs, excludeblogs, and blog_ids. Default is “0”
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
Alias of role.
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 author data. See lastn for example.
Supported values:
display_namenamecreated_onscorerateOrder of returned authors. See lastn for example.
Supported values:
ascend (default)descendSupported values:
enabled (default)disabledSpecifies 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.
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>
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:
Specify namespace for score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AuthorScore namespace="FiveStarRating"$>
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:
Specify namespace for avarage score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AuthorScoreAvg namespace="FiveStarRating"$>
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:
Specify namespace for the number of scorings to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AuthorScoreCount namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AuthorScoreHigh namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:AuthorScoreLow namespace="FiveStarRating"$>
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.
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" />
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>
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.
Outputs the Archive URL of the blog currently in context. An ending '/' character is guaranteed.
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 supports the multiblog template tags.
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.
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>
Publishes the license URL of the Creative Commons logo appropriate to the license assigned to the blog inc ontex.t If the blog doesn't have a Creative Commons license, this tag returns an empty string.
Returns the number of published comments associated with the blog currently in context.
Outputs the description field of the blog currently in context.
Returns the number of published entries associated with the blog currently in context.
This template tag supports the multiblog template tags.
This template tag also supports all of the same filtering mechanisms defined by the <mt:Entries> tag allowing users to retrieve a count of the number of entries on a blog that meet a certain criteria.
If a blog had 23 entries
<$mt:BlogEntryCount$>
will output the number
23
Returns the configured blog filename extension, including a leading '.' character. If no extension is assigned, this returns an empty string.
The host name part of the absolute URL of your blog.
Attributes:
Removes any specified port number if this attribute is set to true (1), otherwise it will return the hostname and port number (e.g. www.somedomain.com:8080).
If set to 1, then this template tag will instead return a unique signature for the hostname, by replacing all occurrences of decimals (".") with underscores ("_").
Outputs the numeric ID of the blog currently in context.
A conditional tag that is true when the current blog in context has been assigned a Creative Commons License.
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.
The blog's specified language for date display. This setting can be changed on the blog's Entry settings screen.
Attributes:
If assigned, will format the language in the style "language_LOCALE" (ie: "en_US", "de_DE", etc).
If assigned, will change any '_' in the language code to a '-', conforming it to the IETF RFC # 3066.
Outputs the name of the blog currently in context.
The number of published pages in the blog. This template tag supports the multiblog template tags.
Example:
<$mt:BlogPageCount$>
Returns a count of published TrackBack pings associated with the blog currently in context.
Similar to the BlogURL tag, but removes any domain name from the URL.
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.
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.
A container tag which iterates over a list of all of the blogs in the system. You can use any of the blog tags (BlogName, BlogURL, etc - anything starting with MTBlog) inside of this tag set.
Outputs the Site Root field of the blog currently in context. An ending '/' character is guaranteed.
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.
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:
If specified, will produce the timezone without the ":" character ("+|-hhmm" only).
Outputs the Site URL field of the blog currently in context. An ending '/' character is guaranteed.
Returns the ID of the template (index, archive or system template) currently being built.
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>
A container tag representing a calendar month that lists a single calendar "cell" in the calendar display.
Attributes:
An optional attribute that specifies the calendar month and year the tagset is to generate. The value must be in YYYYMM format. The month attribute also recognizes two special values. Given a value of "last", the calendar will be generated for the previous month from the current date. Using a value of "this" will generate a calendar for the current month.
The default behavior is to generate a monthly calendar based on the archive in context. When used in the context of an archive type other then "Category," the calendar will be generated for the month in which the archive falls.
An optional attribute that specifies the name of a category from which to return entries.
Example:
To produce a calendar for January, 2002 of entries in the category "Foo":
<mt:Calendar month="200201" category="Foo">
...
</mt:Calendar>
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$>
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$>
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$>
A conditional tag that will display its contents if the current calendar cell is for a day in another month.
Example:
<mt:CalendarIfBlank> </mt:CalendarIfBlank>
A conditional tag that will display its contents if there are any entries for this day in the blog.
<mt:CalendarIfEntries>
<mt:Entries limit="1">
<a href="<$mt:ArchiveLink type="Daily"$>">
<$mt:CalendarDay$>
</a>
</mt:Entries>
</mt:CalendarIfEntries>
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.
A conditional tag that will display its contents if the current cell is for the current day.
A conditional tag that will display its contents before a calendar week is ended.
Example:
<mt:CalendarWeekFooter></tr></mt:CalendarWeekFooter>
A conditional tag that will display its contents before a calendar week is started.
Example:
<mt:CalendarWeekHeader><tr></mt:CalendarWeekHeader>
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$>';
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.
A comma delimited list of blog ids specifying which blogs to include categories from, or the word “all” to include categories from all blogs in the installation.
This attribute aggregates categories from multiple blogs:
<mt:Categories blog_ids="1,12,19,37,112">
A value of “all” expands the context to all blogs (in the installation) except those blogs which have been explicitly forbidden their content from being aggregated in the Multiblog blog plugin settings.
<mt:Categories blog_ids="all">
Alias of include_blogs.
Accepted values are “category” (default) and “folder”. Because folders are essentially categories for pages, category and folder template tags are interchangeable. Using <mt:Folders> is the same as using <mt:Categories class_type="folder">.
A comma delimited list of blog ids specifying which blogs to exclude categories from when including categories from all blogs in the installation.
This attribute aggregates categories from all blogs except those with ids specified:
<mt:Categories exclude_blogs="1,12,19,37,112">
Blogs which have been explicitly forbidden their content from being aggregated in the Multiblog blog plugin settings are not included.
Related to blog_ids.
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.
Alias of blog_ids. Related to exclude_blogs.
Limits output to the first N categories. N is a positive integer.
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.
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 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="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a></li>
<mt:Else>
<li><$mt:CategoryLabel$></li>
</mt:If>
<mt:If name="__last__">
</ul>
</mt:If>
</mt:Categories>
<mt:Categories class_type="folder"> attributeDeprecated: Use
<$mt:ArchiveLink$>
A link to the archive page of the current category. Should be used in the context of a Category archive template.
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>
Produces the dirified basename defined for the category in context.
A value to use in the event that no category is in context.
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.
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.
Returns the number of comments associated to entries within the category in context.
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>
The number of published entries for the category in context.
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>
Deprecated: Same as
mt:CustomFieldDescription. See EntryCustomFields for more info.
This will display the description of the current custom field in context.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
This container tag iterates, or loops, over the list of custom fields associated with an category.
See mt:EntryCustomFields for more details.
<mt:Categories>
<mt:CategoryCustomFields>
<$mt:CustomFieldName$>
</mt:CategoryCustomFields>
</mt:Categories>
Custom field name of the field you wish to exclude from the loop.
<mt:CategoryCustomFields exclude="Foo Field">
<$mt:CustomFieldName$>
</mt:CategoryCustomFields>
See mt:EntryCustomFields for more examples.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
The description for the category in context.
List categories with descriptions:
<dl>
<mt:Categories>
<dt>
<$mt:CategoryLabel$>
</dt>
<dd>
<$mt:CategoryDescription$>
</dd>
</mt:Categories>
</dl>
The numeric system ID of the category.
List categories with category IDs:
<dl>
<mt:Categories>
<dt>
<$mt:CategoryLabel$>
</dt>
<dd>
<$mt:CategoryID$>
</dd>
</mt:Categories>
</dl>
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.
Display the count of trackbacks for the category in context and the trackback link:
<mt:CategoryIfAllowPings>
<!-- do something -->
<$mt:CategoryTrackbackCount$>
<$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>
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):
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:EntryCategoryfunction tag will output the same value as themt:FolderLabelfunction tag when used in the context of a page. Unlike themt:PageFoldertag which is block tag and must be used with themt:FolderLabeltag.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>
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.
Specifies whether categories with no entries assigned should be counted and displayed.
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>
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.
Specifies whether categories with no entries assigned should be counted.
See mt:CategoryNext for more examples of mt:CategoryPrevious usage.
The number of published TrackBack pings for the category in context.
Use the mt:Pings loop to list the pings for a category.
Display the count of trackbacks for the category in context and the trackback link:
<mt:CategoryIfAllowPings>
<!-- do something -->
<$mt:CategoryTrackbackCount$>
<$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>
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.
Display the count of trackbacks for the category in context and the trackback link:
<mt:CategoryIfAllowPings>
<!-- do something -->
<$mt:CategoryTrackbackCount$>
<$mt:CategoryTrackbackLink$>
</mt:CategoryIfAllowPings>
Returns the RDF markup for a Creative Commons License. If the blog has not been assigned a license, this returns an empty string.
Attributes:
If specified, forces the trailing "index" filename to be left on any entry permalink published in the RDF block.
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:
If set, exclude the port number from the CGIHost.
The value of the CGIPath configuration setting.
Example (the output is guaranteed to end with "/",
so appending one prior to a script name is unnecessary):
<a href="<$mt:CGIPath$>some-cgi-script.cgi">
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.
Returns the file path to the directory where Movable Type has been installed. Any trailing "/" character is removed.
Outputs the name field of the current comment in context (for comments left by authenticated users, this will return their display name).
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.
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:
Specifies if the comment author's email can be displayed.
Specifies if the comment author's URL can be displayed.
Specifies to open the link in a new window by adding target="_blank" to the anchor tag.
See example below.
Used in the event that the commenter did not provide a value for their name.
Prevents use of the mt-comments.cgi script to handle the comment author link.
If assigned,
applies a rel="nofollow" link relation to the link.
Outputs the numeric ID of the blog for the current comment in context.
Attributes:
If unspecified, any plaintext links in the comment body will be automatically linked if the blog is configured to do that on the comment preferences screen. If this attribute is specified, it will override the blog preference.
By default, the comment text is formatted according to the comment text formatting choice in the blog preferences. If convert_breaks is disabled, the raw content of the comment body is output without any re-formatting applied.
Limits the length of the comment body to the specified number of words. This is useful for producing a list of recent comments with an excerpt of each.
Outputs the creation date for the current comment in context. See the Date tag for support attributes.
Publishes the commenter's e-mail address.
NOTE: It is not recommended to publish any email addresses.
Attributes:
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>
Outputs the numeric ID for the parent entry (or page) of the current comment in context.
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>
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>
The email address of the commenter. The spam_protect global filter may be used.
Example:
<$mt:CommenterEmail$>
Outputs the numeric ID of the current commenter in context.
Deprecated in favor of the IfCommenterTrusted tag.
The name of the commenter for the comment currently in context.
Example:
<$mt:CommenterName$>
Used to populate the commenter_name Javascript variable. Deprecated in favor of the UserSessionState tag.
Outputs the URL from the profile of the current commenter in context.
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>
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>
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>
This template tag returns the URL to the image of the current commenter's userpic.
Example:
<img src="<$mt:CommenterUserpicURL$>" />
A deprecated tag that formerly published an entry comment form.
Outputs the numeric ID for the current comment in context.
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).
Outputs the IP address where the current comment in context was posted from.
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').
Deprecated in favor of the CommentAuthor tag.
Outputs a number relating to the position of the comment in the list of all comments published using the Comments tag,
starting with "1".
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>
Outputs the ID of the parent comment for the comment currently in context. If there is no parent comment, outputs '0'.
Attributes:
If specified, zero-pads the ID to 6 digits. Example: 001234.
A deprecated tag, replaced with CommentAuthor.
A deprecated tag, replaced with CommentAuthorLink.
A deprecated tag, replaced with CommentBody.
A deprecated tag, replaced with CommentDate.
A deprecated tag, replaced with CommentEmail.
A deprecated tag, replaced with CommentIP.
For the comment preview template only.
For the comment preview template only.
A deprecated tag, replaced with CommentURL.
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:
Specify namespace for rank to be calculated. Namespace is defined by each plugin which leverages rating API.
Allows a user to specify the upper bound of the scale.
Example:
<$mt:CommentRank namespace="FiveStarRating"$>
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>
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>
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:
A custom phrase for the link (default is "Reply").
Custom JavaScript code for the onclick attribute. By default, this value is "mtReplyCommentOnClick(%d, '%s')" (note that %d is replaced with the comment ID; %s is replaced with the name of the commenter).
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:
Display the last N comments in context where N is a positive integer. NOTE: lastn is required in a blog context.
Specifies a number of comments to skip.
Specifies a sort column.
Specifies the sort order and overrides the General Settings. Recognized values are "ascend" and "descend."
Used in conjunction with the "min*", "max*" attributes to select comments based on a particular scoring mechanism.
If 'namespace' is also specified, filters the comments based on the score within that namespace. This specifies the minimum score to consider the comment for inclusion.
If 'namespace' is also specified, filters the comments based on the score within that namespace. This specifies the maximum score to consider the comment for inclusion.
If 'namespace' is also specified, filters the comments based on the rank within that namespace. This specifies the minimum rank to consider the comment for inclusion.
If 'namespace' is also specified, filters the comments based on the rank within that namespace. This specifies the maximum rank to consider the comment for inclusion.
If 'namespace' is also specified, filters the comments based on the count within that namespace. This specifies the minimum count to consider the comment for inclusion.
If 'namespace' is also specified, filters the comments based on the count within that namespace. This specifies the maximum count to consider the comment for inclusion.
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:
Specify namespace for score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:CommentScore namespace="FiveStarRating"$>
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:
Specify namespace for avarage score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:CommentScoreAvg namespace="FiveStarRating"$>
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:
Specify namespace for the number of scorings to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:CommentScoreCount namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:CommentScoreHigh namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:CommentScoreLow namespace="FiveStarRating"$>
Returns the value of the CommentScript configuration setting.
The default for this setting if unassigned is "mt-comments.cgi".
The contents of this container tag will be displayed when the last comment listed by a Comments or CommentReplies tag is reached.
The contents of this container tag will be displayed when the first comment listed by a Comments or CommentReplies tag is reached.
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.
Returns the full file path for the Movable Type configuration file (mt-config.cgi).
A function tag returns a number represents the number of current page. The number starts from 1.
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.
Returns the description entered when custom field was created for the object in context.
<$mt:CustomFieldDescription$>
See mt:EntryCustomFields for more documentation.
Returns the name or "label" entered when custom field was created for the object in context.
<$mt:CustomFieldName$>
See mt:EntryCustomFields for more documentation.
Returns the value selected or data entered on the "Edit" screen for the object in context.
<$mt:CustomFieldValue$>
See mt:EntryCustomFields for more documentation.
Outputs the current date.
Attributes:
If specified, will use the given date as the date to publish. Must be in the format of "YYYYMMDDhhmmss".
If specified, will publish the date using a phrase, if the date is less than a week from the current date. Accepted values are "1", "2", "3" and "js". The options for "1", "2" and "3" affect the style of the phrase.
Supports display of one duration: moments ago; N minutes ago; N hours ago; N days ago. For older dates in the same year, the date is shown as the abbreviated month and day of the month ("Jan 3"). For older dates, the year is added to that ("Jan 3 2005").
Supports display of two durations: less than 1 minute ago; N seconds, N minutes ago; N minutes ago; N hours, N minutes ago; N hours ago; N days, N hours ago; N days ago.
Supports display of two durations: N seconds ago; N seconds, N minutes ago; N minutes ago; N hours, N minutes ago; N hours ago; N days, N hours ago; N days ago.
When specified, publishes the date using JavaScript, which relies on a MT JavaScript function 'mtRelativeDate' to format the date.
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). The format specifiers supported are:
The 4-digit year. Example: "1999".
The 2-digit month (zero-padded). Example: for a date in September, this would output "09".
The 2-digit day of the month (zero-padded). Example: "05".
The 2-digit hour of the day (24-hour clock, zero-padded). Example: "18".
The 2-digit minute of the hour (zero-padded). Example: "09".
The 2-digit second of the minute (zero-padded). Example: "04".
The numeric day of the week,
in the range 0-6,
where 0 is Sunday.
Example: "3".
The numeric day of the year,
in the range 001-365.
Zero-padded to three digits.
Example: "040".
The two-digit year, zero-padded. Example: %y for a date in 2008 would output "08".
The abbreviated month name. Example: %b for a date in January would output "Jan".
The full month name. Example: "January".
The abbreviated day of the week. Example: %a for a date on a Monday would output "Mon".
The full day of the week. Example: "Friday".
The numeric day of the month (space-padded). Example: " 8".
The two-digit hour on a 12-hour clock padded with a zero if applicable. Example: "04".
The two-digit military time hour padded with a space if applicable. Example: " 9".
The hour on a 12-hour clock padded with a space if applicable. Example: " 4".
Supports date formatting for particular standards.
Outputs the date in the format: "%a, %d %b %Y %H:%M:%S Z".
Outputs the date in the format: "%Y-%m-%dT%H:%M:%SZ".
Converts the date into UTC time.
Identifies the ID of the blog to use for adjusting the time to blog time. Will default to the current blog in context if unset.
Used to force localization of the date to a specific language. Accepted values: "cz" (Czechoslovakian), "dk" (Scandinavian), "nl" (Dutch), "en" (English), "fr" (French), "de" (German), "is" (Icelandic), "ja" (Japanese), "it" (Italian), "no" (Norwegian), "pl" (Polish), "pt" (Portuguese), "si" (Slovenian), "es" (Spanish), "fi" (Finnish), "se" (Swedish). Will use the blog's date language setting as a default.
Format YYYY-MM-DD (2009-05-22)
<$mt:Date format="%Y-%m-%d"$>
Format Month DD, YYY (Friday, May 22, 2009)
<$mt:Date format="%A, %b %e, %Y"$>
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>
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>
<!-- display entry here -->
</mt:Entries>
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.
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:
<mt:If name="some_variable">
'some_variable' is assigned
<mt:Else name="some_other_variable">
'some_other_variable' is assigned
<mt:Else>
'some_variable' nor 'some_other_variable' is assigned
</mt:If>
An alias for the 'Else' tag.
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 attribtutes and modifiers can effect the output of mt:Entries.
All <mt:Entries> attributes are optional. The most common attributes are:
authorblog_idscategorycategoriesdaysexclude_blogsfield:basenameglueidinclude_blogsinclude_subcategorieslastnlimitmax_scoremin_scoremax_ratemin_ratemax_countmin_countnamespaceoffsetrecently_commented_onsort_byscored_bysort_ordertagtagsuniqueAccepts 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:EntryAuthorUsernametag (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>
A comma delimited list of blog ids specifying which blogs to include entries from, or the word “all” to include entries from all blogs in the intallation.
This attribute aggregates entries from multiple blogs:
<mt:Entries blog_ids="1,12,19,37,112">
A value of “all” expands the context to all blogs (in the installation) except those blogs which have been explicitly forbidden their content from being aggregated in the Multiblog blog plugin settings.
<mt:Entries blog_ids="all">
Alias of include_blogs.
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">
Category ID is also a valid value when preceded by a pound (“#”) sign.
<mt:Entries category="#33">
or
<mt:Entries category="((#31 AND #32) OR General) AND NOT #3">
Alias of category.
Filters all posts less than N days old (the date when the page is published). N is a positive 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
A comma delimited list of blog ids specifying which blogs to exclude entries from when including entries from all blogs in the intallation.
This attribute aggregates entries from all blogs except those with ids specified:
<mt:Entries exclude_blogs="1,12,19,37,112">
Blogs which have been explicitly forbidden their content from being aggregated in the Multiblog blog plugin settings are not included.
Related to blog_ids.
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 checkbox custom field with a basename of “subscribe” which is checked:
<mt:Entries field:subscribe="1" sort_by="authored_on" sort_order="descend" limit="5">
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>
Outputs a single entry matching the given entry ID.
<mt:Entries id="33">
Alias of blog_ids. Related to exclude_blogs.
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.
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
limitattribute; when usinglastnit is assumed that recent entries are desired.
Used in Entry Listing archive templates or when sorting by a value other than by publish date. Can be a positive integer or “auto”, which defaults to the “Entry Listing Default” preference in the Entry Settings. Similar to the lastn attribute.
Returns entries with a score lower than the max_score value for the given namespace (required).
Returns entries with a score higher than the min_score value for the given namespace (required).
Returns entries with a rate with the highest average score for the given namespace (required).
Returns entries with the lowest average score for the given namespace (required).
Returns entries with which have been scored the most number of times (with any score) for the given namespace (required).
Returns entries with which have been scored the least number of times (with any score) for the given namespace (required).
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.
Used in coordination with lastn, starts N entries from the start of the list.
N is a positive integer or the keyword “auto” (if dynamic publishing has been enabled) 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>
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.
Defines the data to sort entries. The default value is “authored_on”. Accepted values are:
authored_on - (default) date/time when the entry was published. Editable through the MT user interface.author_idcomment_countcreated_on - date/time when the entry was created. Not editable via MT user interface.excerptfield:BASENAME where BASENAME is the basename of a custom field
Warning: There is a bug 98025 with this attribute as of MT4.261 that causes the
mt:Entriesloop to lose blog context when using thefield:basenamein archive entry listing templates. This issue does not exist in index templates.Workarounds have been found by using another attribute to set context:
Using the include_blogs attribute:
<$mt:blogid setvar="blog_id"$> <MTEntries sort_by="field:your_custom_field" include_blogs="$blog_id"> ... </MTEntries>or in a Category Entry Listing archive using the category attribute:
<$mt:ArchiveTitle setvar="category_label"$> <MTEntries category="$category_label" sort_by="field:your_custom_field"> ... </MTEntries>
modified_on - date/time when the entry was last modified. Not editable via MT user interface.ping_count or trackback_countrate (requires use of namespace attribute)score (requires use of namespace attribute)statustitleUse the limit attribute when sorting as lastn assumes that recent entries are desired.
Allows filtering of entries that were scored by a particular user, specified by username. Requires the namespace attribute.
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">
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">
Alias of tag attribute.
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>
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">
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>
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>
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>
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>
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>
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).
The contents of this container tag will be displayed when the last entry listed by a Entries tag is reached.
The contents of this container tag will be displayed when the first entry listed by a Entries tag is reached.
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>
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 attributesYou can also use any of the other attributes available to mt:Entries; and they should behave just as they do with the original tag.
Because this tag is essentially a pre-filtered version of mt:Entries, please see mt:Entries for more examples.
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.
List and link to an entry’s non-primary categories:
<mt:EntryAdditionalCategories show_empty="1">
<mt:If name="__first__">
<ul>
</mt:If>
<li>
<a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a>
</li>
<mt:If name="__last__">
</ul>
</mt:If>
</mt:EntryAdditionalCategories>
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.
Outputs the unique Atom ID for the current entry in context.
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.
<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>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.
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.
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:
If specified,
this will apply a light obfuscation of the email address,
by encoding any characters that will identify it as an email address (:,
@,
and .) into HTML entities.
Outputs the numeric ID of the author for the current entry in context.
Outputs a linked author name suitable for publishing in the 'byline' of an entry.
Attributes:
If specified,
the published link is given a target attribute of '_blank'.
If set, will allow publishing of an email address if the URL field for the author is empty.
If specified,
this will apply a light obfuscation of any email address published,
by encoding any characters that will identify it as an email address (:,
@,
and .) into HTML entities.
Accepted values: url,
email,
archive.
Note: an 'archive' type requires publishing of "Author" archives.
If present, adds additional CSS class names to the link tag published, identifying the link as a url or email address depending on the type of link published.
An alias of EntryAuthorDisplayName. This tag is deprecated in favor of EntryAuthorDisplayName.
Outputs the Website URL field from the author's profile for the current entry in context.
Outputs the username of the author for the entry currently in context. NOTE: it is not recommended to publish MT usernames.
Outputs the HTML for the userpic of the author for the current entry in context.
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.
Outputs the URL for the userpic image of the author for the current entry in context.
Outputs the basename field for the current entry in context.
Attributes:
Accepts either "-" or "_". If unspecified, the raw basename value is returned.
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$>
The numeric system ID of the blog that is parent to the entry currently in context.
Example:
<$mt:EntryBlogID$>
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$>
Returns the blog URL for the blog to which the entry in context belongs.
Example:
<$mt:EntryBlogURL$>
Outputs the "main" text of the current entry in context.
Attributes:
Accepted values are '0' and '1'. Typically, this attribute is used to disable (with a value of '0') the processing of the entry text based on the text formatting option for the entry.
Accepts any positive integer to limit the number of words that are output.
A container tag that lists all of the categories (primary and secondary) to which the entry is assigned.
This tagset creates a category context within which any category or subcategory tags may be used.
<mt:EntryCategories>
<!-- do something -->
</mt:EntryCategories>
If specified, this string is placed in between each result from the loop.
List and link all entry categories:
<mt:Entries>
<MTEntryCategories glue=", "><a href="<$mt:ArchiveLink type="Category"$>"><$mt:CategoryLabel$></a></MTEntryCategories>
</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>
<MTEntryCategories>
<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>
</MTEntryCategories>
</ul>
<$mt:Var name="entry_category" value=""$>
</mt:Entries>
If entry category is in set (Explore, Savor, Inside, Offbeat, Celebrate), add 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>
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.
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:EntryCategoryfunction tag will output the same value as themt:FolderLabelfunction tag when used in the context of a page. Unlike themt:PageFoldertag which is block tag and must be used with themt:FolderLabeltag.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>
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>
Returns the localized name of the type of entry being published. For English blogs, this is the word "Page" or "Entry".
Example:
<$mt:EntryClassLabel$>
Outputs the number of published comments for the current entry in context.
Outputs the creation date of the current entry in context. See the Date tag for supported attributes.
Deprecated: Same as
mt:CustomFieldDescription. See EntryCustomFields for more info.
This will display the description of the current custom field in context.
Deprecated: Same as
mt:CustomFieldName. See EntryCustomFields for more info.
This will display the name of the current custom field in context.
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.
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>
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>
The following mtml code will loop through every custom field and output the function tags: mt:CustomFieldName, mt:CustomFieldDescription, mt:CustomFieldValue (using the "default" to apply "[no value]" as a default value), mt:CustomFieldBasename, mt:CustomFieldHTML (attributes encodehtml and strip added to encode html attribtutes and place output on one line, respectivly. Remove these attributes when actual html form elements are desired)...
<mt:Entries>
<h1><$mt:EntryTitle$></h1>
<pre>
<mt:EntryCustomFields>
CustomFieldName: <$mt:CustomFieldName$>
CustomFieldDescription: <$mt:CustomFieldDescription$>
CustomFieldValue: <$mt:CustomFieldValue _default="[no value]"$>
CustomFieldBasename: <$mt:CustomFieldBasename$>
CustomFieldHTML: <$mt:CustomFieldHTML encode_html="1" strip=" "$>
</mt:EntryCustomFields>
</pre>
</mt:Entries>
The following tags are more specific aliases of the more generic tags in the above example:
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
Outputs the 'authored' date of the current entry in context. See the Date tag for supported attributes.
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:
A phrase to use for the edit link.
Example:
<$mt:EntryEditLink$>
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.
<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>Ouputs the value of the excerpt field of the current entry in context. If the excerpt field is empty, it will draw from the main text of the entry to generate an excerpt.
Attributes:
If the excerpt field is empty, this flag will prevent the generation of an excerpt using the main text of the entry.
Controls the length of the auto-generated entry excerpt. Does not limit the content when the excerpt field contains content.
When set to '1', applies the text formatting filters on the excerpt content.
Used to output any of the status fields for the current entry in context.
Attributes:
Accepts one of: 'allow_pings', 'allow_comments'.
Ouptuts the numeric ID for the current entry in context.
Attributes:Conditional tag that is positive when the entry in context is configured to allow commenting and the blog and MT installation also permits comments.
Deprecated in favor of IfPingsAccepted.
Deprecated: This tag has been deprecated in favor of mt:IfCategory.
Returns true if the current page or entry belongs to the designated category.
An attribute of label is required.
Label of the Category being conditioned.
Alias of label
<mt:EntryIfCategory label="News">
<!- do something ->
<mt:else>
<!- do something else ->
</mt:EntryIfCategory>
Deprecated in favor of EntryIfCommentsActive.
Conditional tag that is positive when content is in the extended text field of the current entry in context.
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>
If present, the template tag will evaluate if the specified tag is assigned to the current entry.
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>
Outputs the value of the keywords field for the current entry in context.
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.
Identifies the archive type to use when creating the link.
Valid archive types are case sensitive:
Alias of archive_type.
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>
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.
<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>Outputs the modification date of the current entry in context. See the Date tag for supported attributes.
Outputs the "extended" text of the current entry in context. Refer to the EntryBody tag for supported attributes.
A block tag providing a context for the entry immediately following the current entry in context (in terms of authored date).
Bug: In Movable Type 4.x there is a bug where if entries/pages have the exact same date-time then the
mt:EntryPreviousandmt:EntryNextcontainer tags may skip an entry/page. This has been fixed in Movable Type 5.
<mt:Entries>
<$mt:EntryTitle$>
<mt:EntryNext>
The next entry is:
<a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
</mt:EntryNext>
</mt:Entries>
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:
Specifies an alternative archive type to use instead of the individual archive.
When publishing entry permalinks for non-individual archive templates, an anchor must be appended to the URL for the link to point to the proper entry within that archive. If 'valid_html' is unspecified, the anchor name is simply a number-- the ID of the entry. If specified, an 'a' is prepended to the number so the anchor name is considered valid HTML.
If assigned, will retain any index filename at the end of the permalink.
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.
<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>A block tag providing a context for the entry immediately preceding the current entry in context (in terms of authored date).
Bug: In Movable Type 4.x there is a bug where if entries/pages have the exact same date-time then the
mt:EntryPreviousandmt:EntryNextcontainer tags may skip an entry/page. This has been fixed in Movable Type 5.
<mt:Entries>
<$mt:EntryTitle$>
<mt:EntryPrevious>
The previous entry is:
<a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a>
</mt:EntryPrevious>
</mt:Entries>
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:
Specify namespace for rank to be calculated. Namespace is defined by each plugin which leverages rating API.
Allows a user to specify the upper bound of the scale.
Example:
<$mt:EntryRank namespace="FiveStarRating"$>
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.
<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.
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:
Specify namespace for score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:EntryScore namespace="FiveStarRating"$>
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:
Specify namespace for avarage score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:EntryScoreAvg namespace="FiveStarRating"$>
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:
Specify namespace for the number of scorings to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:EntryScoreCount namespace="FiveStarRating"$>
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:
Specify namespace for score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:EntryScoreHigh namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:EntryScoreLow namespace="FiveStarRating"$>
Intended for application template use only. Displays the status of the entry in context. This will output one of "Draft", "Publish", "Review" or "Future".
A container tag used to output infomation about the entry tags assigned to the entry in context.
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.
Attributes:
A text string that is used to join each of the items together. For example:
<mt:EntryTags glue=", "><$mt:TagName$></mt:EntryTags>
would print out each tag name separated by a comma and a space.
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.
<mt:If tag="EntryTags">
The entry "<$mt:EntryTitle$>" is tagged:
<mt:EntryTags glue=", "><$mt:TagName$></mt:EntryTags>
</mt:If>
Outputs the title of the current entry in context.
Attributes:
If specified, will draw content from the "main" text field of the entry if the title is empty.
Outputs the number of published TrackBack pings for the current entry in context.
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:
If enabled, will enclose the RDF markup inside an HTML comment tag.
If specified, will leave any "index.html" (or appropriate index page filename) in the permalink of the entry in context. By default this portion of the permalink is removed, since it is usually unnecessary.
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.
Outputs the TrackBack endpoint for the current entry in context. If TrackBack is not enabled for the entry, this will output an empty string.
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.
Type: block
Example
<mt:Feed>
<!-- do something -->
</mt:Feed>
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.
Type: block
Example
<mt:FeedEntries>
<!-- do something -->
</mt:FeedEntries>
Type: function
Example
<mt:FeedEntryLink />
Type: function
Example
<mt:FeedEntryTitle />
Type: function
Example
<mt:FeedInclude />
Type: function
Example
<mt:FeedLink />
Type: function
Example
<mt:FeedTitle />
Produces a file name and path using the archive file naming specifiers.
Attributes:
A required attribute that defines the template with a string of specifiers. The supported specifiers are (NOTE: do not confuse the following table with the specifiers used for MT date tags. There is no relationship between these -- any similarities are coincidental. These specifiers are tuned for publishing filenames and paths for various contexts.)
The entry's author's display name passed through the dirify global filter. Example: melody_nelson
The same as above except using dashes. Example: melody-nelson
For individual archive mappings, this returns the basename of the entry. By default, this is the first thirty characters of an entry dirified with underscores. It can be specified by using the basename field on the edit entry screen. Example: my_summer_vacation
Same as above but using dashes. Example: my-summer-vacation
The entry's primary category/subcategory path, built using the category basename field. Example: arts_and_entertainment/tv_and_movies
Same as above but using dashes. Example: arts-and-entertainment/tv-and-movies
The entry's primary category label passed through the dirify global filter. Example: arts_and_entertainment
Same as above but using dashes. Example: arts-and-entertainment
2-digit day of the month. Example: 09
3-letter language-dependent abbreviation of the week day. Example: Tue
A numeric entry ID padded with leading zeroes to six digits. Example: 000040
The entry's numeric ID. Example: 40
Archive filename with the specified extension. This can be used instead of %b or %i and will do the right thing based on the context. Example: entry_basename.html or index.html
Same as above but without the file extension. Example: filename
2-digit hour on a 24-hour clock with a leading zero if applicable. Example: 09 for 9am, 16 for 4pm
2-digit hour on a 24-hour clock without a leading zero if applicable. Example: 9 for 9am, 16 for 4pm
The setting of the IndexBasename configuration directive with the default file extension appended. Example: index.html
Same as above but without the file extension. Example: index
3-digit day of year, zero-padded. Example: 040
2-digit month, zero-padded. Example: 07
3-letter language-dependent abbreviation of the month. Example: Sep
2-digit minute, zero-padded. Example: 04
2-digit second, zero-padded. Example: 01
File extension with a leading dot (.). If a file extension has not been specified a blank string is returned. Example: .html
4-digit year. Example: 2005
2-digit year with zero-padding. Example: 05
Example:
<$mt:FileTemplate format="%y/%m/%f"$>
Produces the dirified basename defined for the folder in context.
Attributes:
A value to use in the event that no folder is in context.
Valid values are "_" and "-", dash is the default value. Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.
Example:
<$mt:FolderBasename$>
The number published pages in the folder.
Example:
<$mt:FolderCount$>
Deprecated: Same as
mt:CustomFieldDescription. See EntryCustomFields for more info.
This will display the description of the current custom field in context.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
This container tag iterates, or loops, over the list of custom fields associated with an folder.
See mt:EntryCustomFields for more details.
<mt:Folders>
<mt:FolderCustomFields>
<$mt:CustomFieldName$>
</mt:FolderCustomFields>
</mt:Folders>
Custom field name of the field you wish to exclude from the loop.
<mt:FolderCustomFields exclude="Foo Field">
<$mt:CustomFieldName$>
</mt:FolderCustomFields>
See mt:EntryCustomFields for more examples.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
The description for the folder in context.
Example:
<$mt:FolderDescription$>
The contents of this container tag will be displayed when the last folder listed by a Folders tag is reached.
The contents of this container tag will be displayed when the first folder listed by a Folders tag is reached.
The numeric system ID of the folder.
Example:
<$mt:FolderID$>
The label of the folder in context.
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 ofindexexists 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>
A container tag which creates a folder context of the next folder relative to the current page folder or archived folder.
The path to the folder, relative to the BlogURL.
Example:
For the folder "Bar" in a folder "Foo" <$mt:FolderPath$> becomes foo/bar.
A container tag which creates a folder context of the previous folder relative to the current page folder or archived folder.
A container tags which iterates over a list of all folders and subfolders.
Attributes:
Setting this optional attribute to true (1) will include folders with no pages assigned. The default is false (0), where only folders with pages assigned.
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:
If assigned, the current 'index' of the loop is assigned to this template variable.
Identifies the starting number for the loop.
Identifies the ending number for the loop. Either 'to' or 'end' must be specified.
Provides the amount to increment the loop counter.
If specified, this string is added inbetween each block of the loop.
Within the tag, the following variables are assigned:
Assigned 1 when the loop is in the first iteration.
Assigned 1 when the loop is in the last iteration.
Assigned 1 when the loop index is odd, 0 when it is even.
Assigned 1 when the loop index is even, 0 when it is odd.
Holds the current loop index value, even if the 'var' attribute has been given.
Tracks the number of times the loop has run (starts at 1).
Example:
<mt:For from="2" to="10" step="2" glue=","><$mt:Var name="__index__"$></mt:For>
Produces:
2,4,6,8,10
An alias for the 'Var' tag, and considered deprecated in favor of 'Var'.
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.
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>
Returns true if the current category has no sub-categories.
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.
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>
Returns true if the current folder has a parent folder other than the root.
Returns true if the current category has a sub-category.
Returns true if the current folder has a sub-folder.
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:
A valid HTTP Content-Type value, for example 'application/xml'. Note that you must not specify charset portion of Content-Type header value in this attribute. MT will set the portion automatically by using PublishCharset configuration directive.
Example:
<$mt:HTTPContentType type="application/xml"$>
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.
Attributes:
Declares a variable to test. When none of the comparison attributes are present ("eq", "ne", "lt", etc.) the If tag tests if the variable has a "true" value, meaning if it is assigned a non-empty, non-zero value.
Declares a MT tag to execute; the value of which is used for testing. When none of the comparison attributes are present ("eq", "ne", "lt", etc.) the If tag tests if the specified tag produces a "true" value, meaning if it produces a non-empty, non-zero value. For MT conditional tags, the If tag passes through the logical result of that conditional tag.
If specified, applies the specified mathematical operator to the value being tested. 'op' may be one of the following (those that require a second value use the 'value' attribute):
Addition.
Subtraction.
Adds 1 to the given value.
Subtracts 1 from the given value.
Multiplication.
Division.
Issues a modulus operator.
Used in conjunction with the 'op' attribute.
Tests whether the given value is equal to the value of the 'eq' attribute.
Tests whether the given value is not equal to the value of the 'ne' attribute.
Tests whether the given value is greater than the value of the 'gt' attribute.
Tests whether the given value is less than the value of the 'lt' attribute.
Tests whether the given value is greater than or equal to the value of the 'ge' attribute.
Tests whether the given value is less than or equal to the value of the 'le' attribute.
Tests whether the given value matches the regex pattern in the 'like' attribute.
Uses a Perl (or PHP under Dynamic Publishing) expression. For Perl, this requires the "Safe" Perl module to be installed.
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>
Related
Conditional block that is true when the blog has been configured to permit HTML in comments.
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:
The archive type to test for, case-insensitively. See ArchiveType for acceptable values but note that plugins may also provide others.
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="<$MTFileTemplate format="%y/%m/%-F.xml"$>" />
<mt:Else>
<link rel="alternate" type="application/atom+xml"
title="Recent Entries"
href="<$MTLink template="feed_recent"$>" />
</mt:IfArchiveType>
A conditional tag used to test whether a specific archive type is published or not.
Attributes:
Specifies the name of the archive type you wish to check to see if it is enabled.
A list of possible values values for type can be found on the EntryLink tag.
Example:
<mt:IfArchiveTypeEnabled type="Category-Monthly">
<!-- do something -->
<mt:Else>
<!-- do something else -->
</mt:IfArchiveTypeEnabled>
A conditional tag that is true when an author object is in context.
<mt:IfAuthor>
Author: <$mt:AuthorDisplayName$>
</mt:IfAuthor>
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>
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.
<mt:IfCategory>
<!-- Entry is assigned a category -->
</mt:IfCategory>
The name of a category. Tests the category in context (or categories of an entry in context) to see if it matches with the given category name.
Alias of label.
Either the keyword “primary” or “secondary”. Used to test whether the specified category (specified by the label attribute) is a primary or secondary category assignment for the entry in context.
Determine if the entry in context is assigned a category:
<mt:IfCategory>
<!-- Entry is assigned a category -->
<mt:Else>
<!-- Entry is not assigned a category -->
</mt:IfCategory>
Determine if the entry in context has a secondary category assigned:
<mt:IfCategory type="secondary">
<!-- entry in context is assigned to one or more secondary categories -->
</mt:IfCategory>
Determine if the entry in context is assigned the category “News”:
<mt:IfCategory label="News">
<!-- entry in context is assigned to the "News" category -->
</mt:IfCategory>
Determine if the entry in context is the in the primary category “News”:
<mt:IfCategory label="News" type="primary">
<!-- entry in context is assigned the primary category "News" -->
</mt:IfCategory>
Conditional tag that is true when the current comment was left by a user who is also a native MT user.
Conditional tag that is true when the current comment was left by the author of the current entry in context.
A conditional tag that displays its contents if the commenter in context has been marked as trusted.
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>
A conditional tag that is true when the comment currently in context has replies.
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>
Conditional tag that displays its contents if comments are enabled or comments exist for the entry in context.
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.
A conditional tag that is true when the blog is configured to moderate incoming comments from anonymous commenters.
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.
Returns true if the current publishing context is dynamic publishing, and false otherwise.
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:
The name of a folder. If given, tests the folder in context (or folder of an entry in context) to see if it matches with the given folder name.
Example:
<mt:IfFolder name="News">
(current page in context is in the "News" folder)
</mt:IfFolder>
A conditional tag that returns true when the Movable Type installation has the Perl modules necessary for manipulating image files.
Conditional tag that is true when the category in context is an ancestor category of the specified 'child' attribute.
Attributes:
The label of a category in the current blog.
Example:
<mt:IfIsAncestor child="Featured">
(category in context is a parent category
to a subcategory named "Featured".)
</mt:IfIsDescendant>
Conditional tag that is true when the category in context is a child category of the specified 'parent' attribute.
Attributes:
The label of a category in the current blog.
Example:
<mt:IfIsDescendant parent="Featured">
(category in context is a child category
to the 'Featured' category.)
</mt:IfIsDescendant>
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.
A conditional tag used to test whether the requested content has more to show than currently appearing in the page.
Conditional tag that is positive when the blog is configured to require an e-mail address for anonymous comments.
A conditional tag used to test whether a template variable or tag are non-empty. This tag is considered deprecated, in favor of the If tag.
Attributes:
A tag which is evaluated and tested for non-emptiness.
A variable whose contents are tested for non-emptiness.
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:
A tag which is evaluated and tested for non-zeroness.
A variable whose contents are tested for non-zeroness.
Conditional tag that is positive when pings are allowed for the blog and the entry (if one is in context) and the MT installation.
Conditional tag that displays its contents if TrackBack pings are enabled or pings exist for the entry in context.
Conditional tag that is positive when pings are allowed by the blog and the MT installation (does not test for an entry context).
Conditional tag that is positive when the blog has a policy to moderate all incoming pings by default.
A conditional tag used to test whether the requested content has previous page.
A conditional tag that is true when the blog has been configured to permit user registration.
Attributes:
If specified, can be used to test if a particular type of registration is enabled. The core types include "OpenID", "Vox", "LiveJournal", "TypeKey" and "MovableType". The identifier is case-insensitive.
A conditional tag that is true when the blog has been configured to permit anonymous comments.
A conditional tag that is true when the blog has been configured to require user registration.
Conditional tag that is positive when the blog is configured to require an e-mail address for anonymous comments.
Returns true if the current publishing context is static publishing, and false otherwise.
A conditional block which outputs its contents if the search in progress is a regular (or "straight") search.
A conditional block which outputs its contents if the search in progress is a search of entries by tag.
A conditional tag that is true when the current blog in context has been configured with a TypeKey token.
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>
Outputs the uploaded image height in pixels (used only for the system template for uploaded images).
Outputs the uploaded image URL (used only for the system template for uploaded images).
Outputs the uploaded image width in pixels (used only for the system template for uploaded images).
Includes the contents of a template module or external file into the current template where is it used.
<$mt:Include module="Sidebar"$>
Note: One of the following attributes is required and not more than one may be used:
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.
Bug: MT5 Only - Module hierachy doesn’t cause a module to be included from a “website” object before being included from the “system” template modules. To include template modules from a website into a blog, use the following code:
<mt:BlogParentWebsite> <$mt:WebsiteID setvar="website_id"$> </mt:BlogParentWebsite> <$mt:Include module="Entry Metadata" blog_id="$website_id"$>Fogbugz 102199: Include template modules from website templates before system templates
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"$>
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.
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"$>
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.)
For selecting Index templates by their unique identifier.
<$mt:Include identifier="main_index"$>
Alias of cache_key.
The name of a template module in the current blog.
<$mt:Include module="Sidebar"$>
For application template use: identifies an application template by filename to load.
Causes the include to be handled as a server-side include. The value of the ssi attribute determines the type of include that is produced.
Acceptable values are: php, asp, jsp, shtml. Default value is “0”.
This causes the contents of the include to be processed and written to a file (stored to the blog’s publishing path, under the ‘includes_c’ subdirectory).
The include tag itself then returns the include directive appropriate to the ssi type specified.
To generate the contents for the “Tag Cloud” template module and write it to a “tag_cloud.php” file use this mtml:
<$mt:Include module="Tag Cloud" ssi="php"$>
The output is a php include tag:
<?php include("/path/to/blog/includes_c/tag_cloud.php") ?>
Suitable for module, widget, and identifier includes.
Specifies the lifetime in seconds of a cached template module. Suitable for module, widget or identifier includes.
See cache for example.
The name of the widget in the current blog to include.
<$mt:Include widget="Search Box"$>
Also, other attributes given to this tag are locally assigned as variables when invoking the include template.
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>
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>
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 IncludeBlock tag 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:
Supplies a variable name to use for assigning the contents of the IncludeBlock tag. If unassigned, the "contents" variable is used.
Outputs the IndexBasename MT configuration setting.
Attributes:
If specified, will append the blog's configured file extension.
Outputs the URL for the current index template in context. Used in an IndexList tag.
Attributes:
If enabled, will retain the "index.html" (or similar index filename) in the link.
A block tag that builds a list of all available index templates, sorting them by name.
Outputs the name for the current index template in context. Used in an IndexList tag.
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:
The name of the index template.
A template identifier.
The numeric system ID of the entry.
If not set to 1, remove index filenames (by default, index.html) from resulting links.
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 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.
The name of the array, hash data to process.
Alias of name.
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:
reverse - reverses the orderkey - sort by keyvalue - sort by valuenumeric - sort numerically by value (only necessary when combined with value attribute)If specified, this string will be placed in between each “row” of data produced by the loop tag.
Within the tag, the following variables are assigned and may be used:
Assigned when the loop is in the first iteration.
Assigned when the loop is in the last iteration.
Assigned 1 when the loop is on odd numbered rows, 0 when even.
Assigned 1 when the loop is on even numbered rows, 0 when odd.
When looping over a hashref template variable, this variable is assigned the key currently in context.
This variable holds the value of the array or hashref element currently in context.
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>
Type: block
Example
<mt:MarkdownOptions>
<!-- do something -->
</mt:MarkdownOptions>
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.
Type: block
<mt:MultiBlog>
<!-- do something -->
</mt:MultiBlog>
Include the last 4 entries from the category "Releases" in blog with the ID of 1
<MTMultiBlog include_blogs="1">
<MTEntries category="Releases" lastn="4">
<$MTEntryTitle$>
</MTEntries>
</MTMultiBlog>
Type: block
Example
<mt:MultiBlogIfLocalBlog>
<!-- do something -->
<mt:else>
<!-- do something else -->
</mt:MultiBlogIfLocalBlog>
Type: block
Example
<mt:MultiBlogLocalBlog>
<!-- do something -->
</mt:MultiBlogLocalBlog>
A function tag returns the URL points to the next page of the current page that is being rendered.
A container tag whose contents are displayed only if there is no search performed.
This tag is only recognized in search templates.
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.
Returns the value of the NotifyScript configuration setting.
The default for this setting if unassigned is "mt-add-notify.cgi".
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:
type="service type" (optional)
Limits listed profiles to a certain type of service. Common service types are:
contact (AIM, Yahoo! Messenger, etc)blog (Vox, Tumblr, the Website service, etc)photos (Flickr, Smugmug, etc)video (Vimeo, YouTube, etc)links (del.icio.us, Digg, etc)status ( Twitter, etc)network (Facebook, MySpace, etc)If you only want to output profiles from "contact" type services, use the following:
<mt:OtherProfiles type="contact">
If you want to output profiles from all services except contact-type services, use the following:
<mt:OtherProfiles type="NOT contact">
author="author username" (optional)
Limits listed profiles to only specified authors' profiles. Use an author's login account name (username) here.
For example, with this code only the profile of the author with the username "Melody" will be shown:
<mt:OtherProfiles author="Melody">
To show the profiles of several authors, separate their usernames with a comma:
<mt:OtherProfiles author="Melody,Nelson">
display_name="author display name" (optional)
Limits listed profiles to only specified users' profiles. Use an author's profile display name here.
For example, with this code only the profile of the user with the display name "Melody Nelson" will be shown:
<mt:OtherProfile display_name="Melody Nelson">
To show the profiles of several authors, separate their display names with commas:
<mt:OtherProfile display_name="Melody Nelson,Serge Gainsbourg">
Only one of display_name and author should be specified. If neither are specified, the authors to show 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.
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:
name (required)
The property of the selected profile to show. Available properties are:
type, the registry key/ID for the profile servicelabel, the human readable (for example, "Flickr Profile")ident, the author's identifier for the current profileuri, the URL of the author's profile on the remote serviceA container tag which iterates over a list of assets for the current page in context. Supports all the attributes provided by the Assets tag.
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$>
The email address of the page's author.
Note: It is not recommended to publish email addresses.
Example:
<$mt:PageAuthorEmail$>
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:
Specifies if the author's email can be displayed. The default is false (0).
Specifies if the author's URL can be displayed. The default is true (1).
Specifies to open the link in a new window by adding "target=_blank" to the anchor tag. See example below. The default is false (0).
Examples:
<$mt:PageAuthorLink$>
<$mt:PageAuthorLink new_window="1"$>
The URL of the page's author.
Example:
<$mt:PageAuthorURL$>
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:
Valid values are "_" and "-", dash is the default value. Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.
Example:
<$mt:PageBasename$>
This tag outputs the contents of the page's Body field.
If a text formatting filter has been specified, it will automatically applied.
Attributes:
Trims the number of words to display. By default all are displayed.
Controls the application of text formatting. By default convert_breaks is 0 (false). This should only be used if text formatting is set to "none" in the Entry/Page editor.
Example:
<$mt:PageBody$>
Deprecated: Same as
mt:CustomFieldDescription. See EntryCustomFields for more info.
This will display the description of the current custom field in context.
Deprecated: Same as
mt:CustomFieldName. See EntryCustomFields for more info.
This will display the name of the current custom field in context.
This container tag iterates, or loops, over the list of custom fields associated with an page.
See mt:EntryCustomFields for more details.
<mt:Pages>
<mt:PageCustomFields>
<$mt:CustomFieldName$>
</mt:PageCustomFields>
</mt:Pages>
Custom field name of the field you wish to exclude from the loop.
<mt:PageCustomFields exclude="Foo Field">
<$mt:CustomFieldName$>
</mt:PageCustomFields>
See mt:EntryCustomFields for more examples.
Deprecated: Same as
mt:CustomFieldValue. See EntryCustomFields for more info.
This will display the value of the current custom field in context.
The authored on timestamp for the page.
Attributes:
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). See the Date tag for the supported formats.
Forces the date to the format associated with the specified language.
Forces the date to UTC format.
Example:
<$mt:PageDate$>
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 ("...").
The length of the auto-generated output of this tag can be set in the blog's Entry Settings.
Attributes:
When set to 1, the system will not auto-generate an excerpt if the excerpt field of the page is left blank. Instead it will output nothing.
When set to 1, the page's specified text formatting filter will be applied. By default, the text formatting is not applied and the excerpt is published either as input or auto-generated by the system.
Example:
<$mt:PageExcerpt$>
A container tag which holds folder context relating to the page.
<mt:PageFolder>
<$mt:FolderLabel$>
</mt:PageFolder>
Tip: Due to legacy taging the
mt:EntryCategoryfunction tag will output the same value as themt:FolderLabelfunction tag when used in the context of a page. Unlike themt:PageFoldertag which is block tag and must be used with themt:FolderLabeltag.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>
A numeric system ID of the Page currently in context.
Example:
<$mt:PageID$>
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>
If present, the template tag will evaluate if the specified tag is assigned to the current page.
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>
The specified keywords of the page in context.
Example:
<$mt:PageKeywords$>
The last modified timestamp for the page.
Attributes:
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). See the Date tag for the supported formats.
Forces the date to the format associated with the specified language.
Forces the date to UTC format.
Example:
<$mt:PageModifiedDate$>
This tag outputs the contents of the page's Extended field.
If a text formatting filter has been specified it will automatically applied.
Attributes:
Controls the application of text formatting. By default convert_breaks is 0 (false). This should only be used if text formatting is set to "none" in the Entry/Page editor.
Example:
<$mt:PageMore$>
A container tag that create a context to the next page.
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$>
A container tag that create a context to the previous page.
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.
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.
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 attriutes of mt:Entries can also be used with mt:Pages.
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.
All of the non entry-specific attributes of mt:Entries can be used with mt:Pages.
Attributes unique to mt:Pages:
Filter the resulting pages by a particular folder. Use folder label (not folder basename) as the value. Similar to mt:Entries category
<mt:Pages folder="About Us">
<$mt:PageLabel$>
</mt:Pages>
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 in mt: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:PageLabel$>
</mt:Pages>
Returns all pages not associated to a folder.
List all pages not contained in a folder:
<mt:Pages no_folder="1">
<!-- do something -->
</mt:Pages>
Display the 10 most recent pages in the folder “Locations”:
<mt:Pages folder="Locations" lastn="10">
<!-- do something -->
</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">
<!-- do something -->
</mt:Pages>
The contents of this container tag will be displayed when the last page listed by a Pages tag is reached.
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>
A container tag which create a context about the assigned tags. Analogous to EntryTags.
Attributes:
A string used to join the output of the separate iterations of this tag.
Example:
Listing out the page's tags, separated by commas:
<mt:PageTags glue=", "><$mt:TagName$></mt:PageTags>
The title of the page in context.
Example:
<$mt:PageTitle$>
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>
This optional boolean attribute controls the exclusion of the current category in the list.
This optional attribute is a shortcut for connecting each category label with its value.
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$>
A container tag that creates a context to the current category’s parent, if category is assigned a parent category.
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
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>
A block tag that lists all the ancestors of the current folder.
Attributes:
This optional attribute is a shortcut for connecting each folder label with its value. Single and double quotes are not permitted in the string.
This optional boolean attribute controls the exclusion of the current folder in the list.
The site name that sent the TrackBack ping.
Example:
<$mt:BlogName$>
The timestamp of when the ping was submitted. Date format tags may be applied with the format attribute along with the language attribute.
Attributes:
A string that provides the format in which to publish the date. If unspecified, the default that is appropriate for the language of the blog is used (for English, this is "%B %e, %Y %l:%M %p"). See the Date tag for the supported formats.
Forces the date to the format associated with the specified language.
Forces the date to UTC time zone.
Produces a relative date (relative to current date and time). Suitable for dynamic publishing (for instance, from PHP or search result templates). If a relative date cannot be produced (the archive date is sufficiently old), the 'format' attribute will govern the output of the date.
Example:
<$mt:PingDate$>
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>
An excerpt describing the URL of the ping sent.
Example:
<$mt:PingExcerpt$>
A numeric system ID of the TrackBack ping in context.
Example:
<$mt:PingID$>
The IP (Internet Protocol) network address the TrackBack ping was sent from.
Example:
<$mt:PingIP$>
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:
Specify namespace for rank to be calculated. Namespace is defined by each plugin which leverages rating API.
Allows a user to specify the upper bound of the scale.
Example:
<$mt:PingRank namespace="FiveStarRating"$>
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:
This attribute creates a specific category context regardless of its placement.
Display the last N pings in context. N is a positive integer.
Specifies the sort order. Recognized values are "ascend" (default) and "descend."
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:PingScore namespace="FiveStarRating"$>
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:
Specify namespace for avarage score to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:PingScoreAvg namespace="FiveStarRating"$>
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:
Specify namespace for the number of scorings to be calculated. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:PingScoreCount namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:PingScoreHigh namespace="FiveStarRating"$>
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:
Specify namespace for the score to be sorted. Namespace is defined by each plugin which leverages rating API.
Example:
<$mt:PingScoreLow namespace="FiveStarRating"$>
The contents of this container tag will be displayed when the last ping listed by a Pings tag is reached.
The contents of this container tag will be displayed when the first ping listed by a Pings tag is reached.
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>
The URL of the TrackBack ping was sent to. This is the TrackBack Ping URL and not a permalink.
Example:
<$mt:PingsSentURL$>
The title of the remote resource that the TrackBack ping sent.
Example:
<$mt:PingTitle$>
The URL of the remote resource that the TrackBack ping sent.
Example:
<$mt:PingURL$>
A function tag returns the URL points to the previous page of the current page that is being rendered.
The Movable Type edition in use.
Attributes:
If specified, also outputs the version (same as Version).
Example:
<$mt:ProductName$>
for the MTOS edition, this would output:
Movable Type Open Source
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:
If specified and true, only profile services implemented by other MT plugins
besides Action Streams are listed.
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 |
The value of the PublishCharset directive in the system configuration.
Example:
<$mt:PublishCharset$>
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.
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.
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$>" />
Returns the value of the SearchMaxResults or MaxResults configuration setting.
Use SearchMaxResults because MaxResults is considered deprecated.
The number of results found across all of the blogs searched. This tag is only recognized in search templates.
Example:
<$mt:SearchResultCount$>
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.
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>
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>
Returns the value of the SearchScript configuration setting.
The default for this setting if unassigned is "mt-search.cgi".
An HTML-encoded search query. This tag is only recognized in search templates.
Example:
<$mt:SearchString$>
Returns the identifier of the search template (ie, "feed" or "nomorepizzaplease").
Example:
<$mt:SearchTemplateID$>
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:
When specified,
causes the contents of the section tag to be cached for some period of time.
The 'period' attribute can specify the cache duration (in seconds),
or will use the DashboardCachePeriod configuration setting as a default (this feature was initially added to support cacheable portions of the Movable Type Dashboard).
A number in seconds defining the duration to cache the content produced by the tag. Use in combination with the 'cache_prefix' attribute.
When using the 'cache_prefix' attribute, specifying '1' for this attribute will cause the content to be cached on a per-blog basis (otherwise, the default is system-wide).
When using the 'cache_prefix' attribute, specifying '1' for this attribute will cause the content to be cached on a per-user basis (otherwise, the default is system-wide).
If specified, causes the content of the tag to be enclosed in a the HTML tag identified. Example:
<mt:Section html_tag="p">Lorem ipsum...</mt:Section>
Which would output:
<p>Lorem ipsum...</p>
If specified in combination with the 'html_tag' attribute, this 'id' is added to the wrapping HTML tag.
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}"$>
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:
Identifies the name of the template variable. See Var for more information on the format of this attribute.
The value to assign to the variable.
See the Var tag for more information about this attribute.
If specified, places the contents at the front of any existing value for the template variable.
If specified, places the contents at the end of any existing value for the template variable.
Related Tags:
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:
Identifies the name of the template variable. See Var for more information on the format of this attribute.
See the Var tag for more information about this attribute.
If specified, places the contents at the front of any existing value for the template variable.
If specified, places the contents at the end of any existing value for the template variable.
Related Tags:
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:
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:
Identifies the name of the template variable. See Var for more information on the format of this attribute.
Example:
<mt:SetVarTemplate name="entry_title">
<h1><$MTEntryTitle$></h1>
</mt:SetVarTemplate>
<mt:Entries>
<$mt:Var name="entry_title"$>
</mt:Entries>
Related Tags:
Outputs a link to the MT Comment script to allow a user to sign in to comment on the blog.
The value of the SignOnURL configuration setting.
Outputs a link to the MT Comment script to allow a signed-in user to sign out from the blog.
Type: function
Example
<mt:SmartyPantsVersion />
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.
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" />
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:
name (optional)
The name of the author whose action this is. If not given, the author's
profile display name is used. Note that by specifying an empty name (that is, name=""),
the name will be omitted from the StreamAction result.
<mt:ActionStreams limit="10">
<li>
<mt:Include module="Userpic">
<a href="/profile/<mt:AuthorName dirify="1">">
<mt:AuthorDisplayName escape="html">
</a>
<mt:StreamAction name="">
</li>
</mt:ActionStreams>
<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><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>mt:StreamActionDate>. The date the entry received a comment or was updated is output as <mt:StreamActionModifiedDate>.<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>Modifiermt:Date> function tag. <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>
<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>
<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>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>
<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><$mt:StreamActionVar name="parameter"$>
mt:StreamActionVar name="title">mt:StreamActionVar name="url">A specialized version of the mt:Categories block tag that respects the hierarchical structure of categories.
<mt:SubCategories top="1">
<!-- do something -->
</mt:SubCategories>
Use of either top or category attribute is required.
Bug: As of MT4.261: mt:SubCategories outputs nothing by default Case 100897
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.
A boolean attribute controling inclusion of the current category specified in the category attribute in the list.
Bug: As of MT4.261:
mt:SubCategoriesattributeinclude_currentdoesn’t “include” current, rather it limits. Case 100896
An advanced usage attribute. A fully qualified Perl method name to be used to sort the categories.
<mt:SubCategories sort_method="Your::Perl::Package::sort_by_entry_count">
<!-- do something -->
</mt:SubCategories>
Specifies the sort order of the category labels. Values “ascend” (default) and “descend”. This attribute is ignored if sort_method has been set.
Display a reversed list of top-level categories:
<mt:SubCategories top="1" sort_order="descend">
<!-- do something -->
</mt:SubCategories>
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>
List the subcategories of “Category AAA”
<ul>
<mt:SubCategories category="Cat AAA">
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
</mt:SubCategories>
</ul>
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>
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>
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.
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>
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.
See mt:SubCategories loop tag for more examples.
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.
See mt:SubCategories loop tag for more examples.
block, categories, category, conditional, last
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.
An optional attribute that specifies the maximum number of times the system should recurse. The default is infinite depth.
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>
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 mtml category tags also work for folders.
Specifies the maximum number of times the system should recurse. Default is infinite depth.
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>
A specialized version of the Folders container tag that respects the hierarchical structure of folders.
Attributes:
An optional boolean attribute that controls the inclusion of the current folder in the list.
An optional and advanced usage attribute. A fully qualified Perl method name to be used to sort the folders.
Specifies the sort order of the folder labels.
Recognized values are "ascend" and "descend." The default is "ascend." This attribute is ignored if sort_method is unspecified.
If set to 1, displays only top level folders. Same as using TopLevelFolders.
Returns the number of entries that have been tagged with the current tag in context.
Outputs the numeric ID of the tag currently in context.
An alias for the 'TagName' tag.
Outputs the name of the current tag in context.
Attributes:
If specified, outputs the "normalized" form of the tag. A normalized tag has been stripped of any spaces and punctuation and is only lowercase.
If specified, causes any tag with spaces in it to be wrapped in quote marks.
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:
Allows a user to specify the upper bound of the scale.
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>
A container tags used for listing all previously assigned entry tags for the blog in context.
Attributes:
A text string that is used to join each of the items together. For example
<mt:Tags glue=", "><$mt:TagName$></mt:Tags>
would print out each tag name separated by a comma and a space.
The kind of object for which to show tags. By default the entry tags are shown.
The tag object column on which to order the tags. Common values are name and rank. By default tags are sorted by name.
The direction in which to sort tags by the sort_by field. Possible values are ascend and descend. By default, tags are shown in ascending order when sorted by name and descending order when sorted by other columns.
A number of tags to show. If given, only the first tags as ordered by sort_by and sort_order are shown.
A number of tags to show. If given, only the given number of tags with the most uses are shown. For example:
<mt:Tags top="20">
<$mt:TagName$>
</mt:Tags>
is equivalent to
<mt:Tags limit="20" sort_by="rank">
<$mt:TagName$>
</mt:Tags>
Note that even when top is used, the tags are shown in the order specified with sort_by and sort_order.
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>
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 modifiers to TagSearchLink to do further transformations.
The example below shows each tag in a cloud tag 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:BlogURL$>tag/<$mt:TagName normalize="1"$>
And of course, you would have to create the .htaccess rules to translate this into a request to mt-search.cgi.
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.
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.
Returns the creation date for the template publishing the current file.
Example:
<$mt:TemplateCreatedOn$>
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!"$>
Type: block
Example
<mt:Textile>
<!-- do something -->
</mt:Textile>
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).
offset: A number that used to offset the published heading tags. If set to 1, each "h1" block is published in a "<h2>" tag, "h2" is published as "<h3>", and so forth.<$mt:TextileHeadOffset offset="2"$>
Type: function
Example
<mt:TextileOptions />
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.
A container tag that creates a context to the top-level ancestor of the current folder.
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">.
Basic listing of the top level folders:
<mt:TopLevelFolders>
<!-- do something -->
<$mt:FolderLabel$>
</mt:TopLevelFolders>
See more examples in the <$mt:SubFolderRecurse$> tag docs.
A container tag that creates a context to the top-level ancestor of the current category.
A function tag returns a number represents the total number of pages in the current search context. The number starts from 1.
Returns the value of the TrackbackScript configuration setting.
The default for this setting if unassigned is "mt-tb.cgi".
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.
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.
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.
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$>
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.
Returns the value of the UserSessionCookieTimeout configuration setting.
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.
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"
}
A function tag used to store (like the <mt:SetVar> tag) and return values from variables.
This tag is one of the most useful tags when digging deeper into creating templates with Movable Type.
Set a variable (no output when setting the value of a variable):
<$mt:Var name="foo" value="bar"$>
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>
<$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
setvarmodifier to set the value of a variable rather than output the value:<$mt:BlogID setvar="foo"$>
Note: Support for various attributes depends on the version of Movable Type.
The most common attributes are in bold.
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
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>
The function attribute supports diffent values for array and hash variables.
For array variables:
count - Returns the number of elements in the array template variable.pop - Takes an element from the end of the array (last element).push - Adds an element onto the end of the array.shift - Takes an element from the front of the array (index 0). Only works with mt:GetVar.unshift - Adds the element to the front of the array (index 0).glue - value used to join the values of an array together.index - Identifies an element of an array template variable.For hash variables:
count - Returns the number of keys present in the hash template variable.default - If the variable is undefined or empty, this value will be output instead.delete - Only valid when used with the ‘key’ attribute, or if a key is present in the variable name.key - Identifies a key of a hash template variable.to_json - Formats the variable in JSON notation.See examples for array and hash variables below.
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)"$>
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.
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
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>
Alias of name.
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>
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>
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>
The version number of the Movable Type system.
Example:
<mt:Version />
An alias for the WidgetSet tag, and considered deprecated.
Publishes the widget set identified by the name attribute.
Attributes:
The name of the widget set to publish.
The target blog to use as a context for loading the widget set. This only affects the loading of the widget set: it does not set the blog context for the widgets that are published. By default, the blog in context is used. You may specify a value of "0" for blog_id to target a global widget set.
Example:
<$mt:WidgetSet name="Sidebar"$>
Returns the value of the XMLRPCScript configuration setting.
The default for this setting if unassigned is "mt-xmlrpc.cgi".