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

Archive // 19 Tags

MTArchiveCategory

The name of the category of the archive in context. For use in Category archives only.

MTArchiveCount

The number of entries in the archive in context.

MTArchiveDate

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 Chapter C: Date Formats.

MTArchiveDateEnd

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 Chapter C: Date Formats.

MTArchiveFile

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

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

MTArchiveLink

An absolute URL to the archive in context.

Optional attributes
  • with_index (default: 0) - Controls whether or not the index filename (ie: index.html) is included at the end of the link. The index filename defaults to 'index' but can be set using the IndexBasename config directive.
  • archive_type - Lets you specify a specific archive type for producing the permalink. Valid types are "Monthly", "Daily", "Weekly", "Category" and "Individual". If the archive type requested is not supported for the blog, this will result in an error.

MTArchiveList

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

Attributes:

  • archive_type - An optional attribute that specifies the type of archives to list. Recognized values are "Monthly," "Weekly," "Daily," "Individual" and "Category." The default is to list the Preferred Archive Type specified in the weblog settings.
  • lastn - An optional attribute that can be used to limit the number of archives in the list.
  • sort_order - An optional attribute that specifies the sort order of the archives in the list. It is effective within the following archives: Daily archive, Weekly archive, Monthly archive, Individual Entry archive. Recognized values are "ascend" and "descend".

MTArchiveListFooter

The contents of this container tag will be displayed when the last archive listed by a MTArchiveList tagset is reached.

MTArchiveListHeader

The contents of this container tag will be displayed when the first archive listed by a MTArchiveList tagset is reached.

MTArchiveNext

A container tag that creates a context to the "next" archive in date-based archives (cannot be used in category archives).

Attributes:

  • archive_type - Specifies the "next" archive type the context is for. Recognized values are "Monthly," "Weekly," "Daily," and "Individual". The default is the current archive type.

MTArchivePrevious

A container tag that creates a context to the "previous" archive in date-based archives (cannot be used in category archives).

Attributes:

  • archive_type - Specifies the "previous" archive type the context is for. Recognized values are "Monthly," "Weekly," "Daily," and "Individual". The default is the current archive type.

MTArchiveTitle

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

  • Category - The label of the category.
  • Daily - The date in "Month, Day YYYY" form.
  • Weekly - The range of dates in the week in "Month, Day YYYY - Month, Day YYYY"
  • Monthly - The range of dates in the week in "Month YYYY" form.
  • Individual - The title of the entry.

MTArchiveType

The language-dependent archive type (e.g. Category, Individual, Daily, Weekly or Monthly) for the archive in context.

MTArchives

A container tag representing a list of all the enabled archive types in a weblog.

MTFileTemplate

Produces a file name and path using the archive file naming specifiers. See Chapter E: Archive File Path Specifiers.

Attributes:

  • format - A required attribute that defines the template with a string of specifiers.

MTIfArchiveTypeEnabled

A conditional tag used to test whether a given archive type is enabled for publishing.

Attributes:

  • archive_type - Required. Specifies the type to test the archive in context against. Recognized values are "Monthly," "Weekly," "Daily," "Individual" and "Category."

MTIndexLink

An absolute URL to the index template in context. For use within MTIndexList.

MTIndexList

A container that lists all the active index templates.

Are there any attributes to this container?

MTIndexName

The name of the index template in context. For use within MTIndexList.

Blog // 18 Tags

MTBlogArchiveURL

The absolute URL to your weblog archives.

MTBlogCCLicenseURL

The absolute URL corresponding to information about the Creative Commons license that you have chosen.

MTBlogCommentCount

The number of published comments in the weblog.

MTBlogDescription

The weblog description specified in General Settings.

MTBlogEntryCount

The number of published entries in the weblog.

MTBlogFileExtension

The file extension for archive files specified in weblog's Publishing Settings.

MTBlogHost

The host name part of the absolute URL of your weblog.

Attributes:

  • exclude_port - Removes any specified port number if this attribute is set to true (1).

MTBlogID

The numeric system ID of the weblog.

MTBlogIfCCLicense

A conditional tag whose contents will be displayed if you have selected a Creative Commons license in your weblog settings.

MTBlogLanguage

The weblog's specified language for date display. This setting can be changed on the weblog's General settings menu.

MTBlogName

The name of the weblog. This can be changed on the weblog's General settings menu.

MTBlogPingCount

Outputs the number of pings received on the weblog in context.

MTBlogRelativeURL

The relative URL of your weblog extracted from the "Site URL" in Publishing Settings. See MTBlogURL for the absolute URL.

MTBlogSitePath

The "Local Site Path" of your weblog as specified in the Site Root setting found in the blog's Publishing settings screen.

Related

MTBlogTimezone

The timezone that has been specified for the weblog displayed as an offset from UTC in +|-hh:mm format.

MTBlogURL

The absolute URL of your weblog as specified on the weblog's Publishing settings screen.

MTBlogs

A container tag which iterates over a list of all of the weblogs in the system. You can use any of the weblog tags (MTBlogName, MTBlogURL, etc — anything starting with MTBlog) inside of this tag set.

Optional attributes
  • blog_ids - This attribute allows you to limit the set of blogs iterated over by MTBlogs. Multiple blogs are specified in a comma-delimited fashion. For example <MTBlogs blog_ids="1,12,19,37,112"> would iterate over only the blogs with IDs 1, 12, 19, 37 and 112. This feature is available only in Movable Type Enterprise.

MTCCLicenseRDF

Outputs the machine-readable RDF corresponding to the Creative Commons license that you have chosen. This tag is context sensitive. If you use it in an entry context, additional information about the entry will included.

Calendar // 10 Tags

MTCalendar

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

Attributes:

  • month - 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.

  • category - An optional attribute that specifies the name of a category from which to return entries.

You can also combine the two attributes. For example:

<MTCalendar month="200201" category="Foo">
 ...
</MTCalendar>

will display all entries from January, 2002 in the category Foo.

MTCalendarCellNumber

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.

MTCalendarDate

The timestamp of the current day of the month. Date format tags may be applied with the format attribute along with the language attribute. See Chapter C: Date Formats.

MTCalendarDay

The numeric day of the month for the cell.

MTCalendarIfBlank

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

MTCalendarIfEntries

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

MTCalendarIfNoEntries

A conditional tag that will display its contents if there are not entries for this day in the weblog. This tag predates the introduction of MTElse, a tag that could be used with MTCalendarIfEntries to replace MTCalendarIfNoEntries.

MTCalendarIfToday

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

MTCalendarWeekFooter

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

MTCalendarWeekHeader

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

Category // 28 Tags

MTCategories

A container tag representing a list of categories in a weblog. This tag produces output for every category with no regard to their hierarchical structure.

  • show_empty

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

MTCategoryArchiveLink

A link to the archive page of the category.

MTCategoryBasename

Produces the dirified basename defined for the category in context.

Optional attributes
  • default - A value to use in the event that no category is in context.
  • separator - Valid values are "_" and "-". Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.

MTCategoryCount

The number of published entries for the category.

MTCategoryDescription

The description for the category.

MTCategoryID

The numeric system ID of the category.

MTCategoryIfAllowPings

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

MTCategoryLabel

The label of the category in context.

MTCategoryNext

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

Optional attribute:

  • show_empty - Specifies whether categories with no entries assigned should be counted

Example code:

<MTCategoryNext>
    Next Category: <a href="<MTArchiveLink archive_type="Category">"><MTCategoryLabel></a>
</MTCategoryNext>

MTCategoryPrevious

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

Optional attribute:

  • show_empty - Specifies whether categories with no entries assigned should be counted

Example code:

<MTCategoryPrevious>

    Previous Category: <a href="<MTArchiveLink archive_type="Category">"><MTCategoryLabel></a>
</MTCategoryPrevious>

MTCategoryTrackbackCount

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

MTCategoryTrackbackLink

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

MTEntriesWithSubCategories

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

Attributes:

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

    Since it is possible for two categories to have the same label, you can specify one particular category by including its ancestors, separated by slashes. For instance if you have a category "Flies" and within it a subcategory labeled "Fruit", you can ask for that category with category="Flies/Fruit". This would distinguish it from a category labeled "Fruit" within another called "Food Groups", for example, which could be identified using category="Food Groups/Fruit".

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

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

MTHasNoParentCategory

A conditional tag that displays its contents if the current category does not have a parent category "above" it. Alternately the MTElse tag can be used in the MTHasParentCategory tagset.

MTHasNoSubCategories

A conditional tag that displays its contents if the current category does not have any subcategories. Alternately the MTElse tag can be used in the MTHasSubCategories tagset.

MTHasParentCategory

A conditional tag that displays its contents if the current category has a parent category "above" it.

MTHasSubCategories

A conditional tag that displays its contents if the current category has one or more subcategories.

MTIfCategory

A conditional block which tests attributes of the category currently in context and outputs its contents on a match.

This tag can be used anywhere where there is a category context:

  • Within an MTEntries loop
  • In a category archive template
  • Within an MTCategories loop
  • Etc

Required attributes

  • name - Name of category for conditional test
  • label - Alias of name attribute above

Optional attribute

  • type - Tests for the assignment type for the category, accepting values of primary and secondary.

NOTE: There is currently a known issue related to this in that the value of 'secondary' is not accepted by the type attribute.

Example code

Conditional output based on category:

<MTIfCategory label="important">
    This is important
<MTElse>
    Misc is not so important
</MTElse>
</MTIfCategory>

This can be used in conjuction with CSS rules to display things differentially. This adds a class attribute of featured to the entry title h2 tag if the category of the entry is "Featured":

<h2 <MTIfCategory name="Featured">class="featured"</MTIfCategory>>
   <MTEntryTitle>
</h2>

Below is a full example testing for not only category assignment, but also the type of assignment.

<MTIfCategory label="misc" type="primary">

    Misc is the primary category
<MTElse>
    <MTIfCategory label="misc" type="secondary">
        Misc is the secondary category
    <MTElse>
        Misc is neither a primary not secondary category
    </MTElse>
    </MTIfCategory>

</MTElse>
</MTIfCategory>

MTIfIsAncestor

A conditional tag that displays its contents if the current category is an ancestor of a specified child category in the subcategory hierarchy.

Attributes:

  • child - Required. The category label of the child to match against.
Related:

MTIfIsDescendant

A conditional tag that displays its contents if the current category is a descendant of a specified parent category in the subcategory hierarchy.

Attributes:

  • parent - Required. The category label of the parent to match against.
Related:

MTParentCategories

A container tag that lists all the ancestors of the current category.

Attributes:

  • glue - This optional attribute is a shortcut for connecting each category label with its value. Single and double quotes are not permitted in the string.
  • exclude_current -This optional boolean attribute controls the inclusion of the current category in the list.

What is the default value of `exclude_current`? true or false? i'm assuming this is a boolean value. the current docs don't say.

MTParentCategory

A container tag that creates a context to the current category's parent.

MTSubCategories

A specialized version of MTCategories that respects the hierarchical structure of categories.

Attributes:

  • include_current - An optional boolean attribute that controls the inclusion of the current category in the list.
  • sort_method - An optional and advanced usage attribute. A fully qualified Perl method name to be used to sort the categories.
  • sort_order - Specifies the sort order of the category labels. Recognized values are "ascend" and "descend." The default is "ascend." This attribute is ignored if sort_method has been set.
  • top - If set to 1, displays only top level categories. Same as using MTTopLevelCategories.
Related

MTSubCatsIsFirst

The contents of this container tag will be displayed when the first category listed by a MTSubCategories tagset is reached.

MTSubCatsIsLast

The contents of this container tag will be displayed when the last category listed by a MTSubCategories tagset is reached.

MTSubCatsRecurse

Recursively call the MTSubcategories or MTTopLevelCategories container with the subcategories of the category 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 subcategories that exist during the loop.

Attributes:

  • max_depth - An optional attribute that specifies the maximum number of times the system should recurse. The default is infinite depth.

Example:

The following code prints out a recursive list of categories/subcategories, linking those with entries assigned to their category archive pages.

<MTTopLevelCategories>

    <MTSubCatIsFirst><ul></MTSubCatIsFirst>
        <MTIfNonZero tag="MTCategoryCount">
            <li><a href="<$MTCategoryArchiveLink$>"
            title="<$MTCategoryDescription$>"><MTCategoryLabel></a>

        <MTElse>
            <li><MTCategoryLabel>
        </MTElse>
        </MTIfNonZero>
        <MTSubCatsRecurse>
        </li>

    <MTSubCatIsLast></ul></MTSubCatIsLast>
</MTTopLevelCategories>

Or more simply:

<MTTopLevelCategories>
    <MTCategoryLabel>

    <MTSubCatsRecurse>
</MTTopLevelCategories>
Related

MTTopLevelCategories

A container listing the categories that do not have a parent and exist at "the top" of the category hierarchy. Same as using MTSubCategories top="1".

Related

MTTopLevelParent

A container tag that creates a context to the top-level ancestor of the current category.

Comment // 35 Tags

MTCommentAuthor

The name of the author of the comment.

  • default

    If a name is not given, the value of this attribute will be used.

Note: This tag only works where a comment is in context, such as within a <MTComments> or <MTEntryComments> container tag.

MTCommentAuthorIdentity

A link to the author's profile within the configured TypeKey authentication system.

MTCommentAuthorLink

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:

  • show_email - Specifies if the comment author's email can be displayed. The default is false (0).
  • show_url - Specifies if the comment author's URL can be displayed. The default is true (1).
  • new_window - 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).
  • default_name - Used in the event that the commenter did not provide a value for their name.

Example code:

<$MTCommentAuthorLink new_window="1"$>

would become

<a href="http://www.sixapart.com/" target="_blank">Six Apart</a>

MTCommentBody

The body of the comment. If any text formatting has been specified it will automatically be applied.

  • convert_breaks

    Controls the application of text formatting. By default convert_breaks is 1 (true).

MTCommentDate

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

MTCommentEmail

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

MTCommentEntry

A container tag that creates a context to the entry associated with the comment.

Example

<MTComments lastn="10">
    <MTCommentEntry>
    <a href="<$MTEntryPermalink$>#comment-<$MTCommentID$>">

            <$MTCommentAuthor$>
    </a>

    commented on 

        <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a>

    </MTCommentEntry>
</MTComments>

MTCommentEntryID

The numeric system ID of the entry associated with the comment.

MTCommentFields

Outputs a standard comments form in HTML for all comments and authentication settings.

  • preview

    Setting this attribute to true (1) specifies that the form is being generated for a comment preview. The default is 0 (false).

MTCommentID

The numeric system ID of the comment.

  • pad

    Adds leading zeros to create a 6 character string. The default is 0 (false). This is equivalent to using the zero_pad global filter with a value of 6.

MTCommentIP

The IP (Internet Protocol) network address the comment was submitted from.

MTCommentOrderNumber

The placement of the comment in numerical order beginning at 1. This value is dependent on the sort order being used.

MTCommentPreviewAuthor


MTCommentPreviewAuthor displays the name of the current commenter during comment preview.

MTCommentPreviewAuthor


MTCommentPreviewAuthor displays the name of the current commenter during comment preview.

MTCommentPreviewBody

MTCommentPreviewBody displays the body of the current comment during comment preview.

MTCommentPreviewDate

MTCommentPreviewDate shows the date of the current comment during comment preview.

MTCommentPreviewEmail

MTCommentPreviewEmail displays the email of the current commenter during comment preview.

MTCommentPreviewIP

MTCommentPreviewIP shows the IP address of the current commenter during comment preview.

MTCommentPreviewState

Deprecated. Do not use.

MTCommentPreviewURL

MTCommentPreviewURL shows the URL of the current commenter during comment preview.

MTCommentURL

The URL of the comment author.

MTCommentURL

The URL of the comment author.

MTCommenterEmail

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

MTCommenterIfTrusted

A conditional block which outputs its contents if the author of the comment in context is both authenticated and has a Trusted status on the current blog.

NOTE:

An `MTElse` block within this tag would only be executed if the commenter was authenticated but not Trusted. If the commenter is not authenticated, the entire block is skipped.

MTCommenterName

The name of the commenter.

MTCommenterNameThunk

Populates the commenter_name Javascript variable.

MTComments

A container tag which iterates over a list of comments on an entry or for a weblog. By default, all comments in context (e.g on an entry or in a weblog) are returned. When used in a blog context, only comments on published entries are returned.

Optional attributes
  • lastn - Display the last N comments in context where N is a positive integer. NOTE: lastn required in a weblog context.

  • sort_order - Specifies the sort order and overrides the General Settings. Recognized values are "ascend" and "descend."

  • blog_ids - This attribute allows you to aggregate comments from other blogs into your MTComments listing. Blogs are specified by their blog IDs in a comma-delimited fashion. (e.g. <MTComments blog_ids="1,12,19,37,112">). A value of all expands the context to all blogs in the installation. This feature is available only in Movable Type Enterprise.

Related

MTComments

A container tag which iterates over a list of comments on an entry or for a weblog. By default, all comments in context (e.g on an entry or in a weblog) are returned. When used in a blog context, only comments on published entries are returned.

Optional attributes
  • lastn - Display the last N comments in context where N is a positive integer. NOTE: lastn required in a weblog context.

  • sort_order - Specifies the sort order and overrides the General Settings. Recognized values are "ascend" and "descend."

  • blog_ids - This attribute allows you to aggregate comments from other blogs into your MTComments listing. Blogs are specified by their blog IDs in a comma-delimited fashion. (e.g. <MTComments blog_ids="1,12,19,37,112">). A value of all expands the context to all blogs in the installation. This feature is available only in Movable Type Enterprise.

MTCommentsFooter

The contents of this container tag will be displayed when the last comment listed by a MTComments tagset is reached.

MTCommentsHeader

The contents of this container tag will be displayed when the first comment listed by a MTComments tagset is reached.

MTFeedbackScore

The composite score of a comment or TrackBack after junk filtering.

MTIfCommenterTrusted

A conditional tag that displays its contents if the commenter in context has be marked as trusted.

What is the difference between MTCommentAuthor and MTCommenterName? what about MTCommentEmail and MTCommenterEmail?

MTIfCommentsAccepted

Conditional tag that displays its contents if commenting is enabled for the entry in context.

MTIfCommentsActive

Conditional tag that displays its contents if comments are enabled or comments exist for the entry in context.

MTIfCommentsModerated

Conditional tag that displays its contents if comment submissions are moderated before being published.

Entry // 39 Tags

MTDateFooter

A container tag whose contents will be displayed if the entry in context was posted on a different day than the following/next entry in the list.

MTDateHeader

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

MTEntries

A container tag which iterates over a list of published entries from a weblog. The default behavior is set according to the "Entries to Display" and "Entry Order" controls in the General Settings. These settings can be overridden with the use of these optional attributes.

Entry Filtering Attributes:

  • author - Filters the entries by the given author's username.
  • category - Filters the entries by the given category label. Multiple categories can be defined in the value of the attribute and can include boolean "AND" and "OR" logic. Boolean logic may not be mixed. For instance "Foo AND Bar OR Baz" is not permitted.
  • tag - Filters the entries by the given assigned tag or a boolean logic construct. See below for details.
  • days - Filters all posts less than N days old. N is a positive integer. days should be used separately from other attributes. If used with another attribute, days is ignored.
  • lastn - Display the last N posts of the weblog. N is a positive integer.
  • offset - Used in coordination with lastn, starts M entries from the start of the list. N is a positive integer.
  • recently_commented_on - Display the N most recently commented-on entries. Each entry will appear in the list only once. N is a positive integer.
  • blog_ids - This attribute allows you to aggregate entries from other blogs into your MTEntries listing. Blogs are specified by their blog IDs in a comma-delimited fashion. (e.g. <MTEntries blog_ids="1,12,19,37,112">). A value of all expands the context to all blogs in the installation. This feature is available only in Movable Type Enterprise.

Entry Sorting Attributes:

  • sort_by - Specifies the field to sort the list by. Recognized values are "title," "modified_on," "author_id," and "excerpt." The default is the authored on date.
  • sort_order - Specifies the sort order and overrides the General Settings. Recognized values are "ascend" and "descend."

When used as an attribute of MTEntries in the templates, the days, lastn, and sort_order attributes override their corresponding settings in the weblog's General settings menu.

Boolean logic for category and tag attributes Can do advanced boolean logic in category and tag attributes (AND, OR, NOT, parenthetical grouping). For example:

<MTEntries category="((Cats AND Dogs) OR General) NOT Private">

Combination of attributes

  • Can combine attributes (e.g. lastn="1" category="Important")
  • Order of attributes matters (i.e. trim_to="10" words="10" is different than words="10" trim_to="10")
  • Repeated attributes are processed (i.e. regexp="[regex1]" regexp="[regex2]")

MTEntriesFooter

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

MTEntriesHeader

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

MTEntryAtomID

A generated immutable identifier for use in Atom syndication feeds.

MTEntryAuthorDisplayName

The display name of the author. If no display name is specified, returns NULL, and no name is displayed.

MTEntryAuthorEmail

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

MTEntryAuthorLink

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 behavior can be altered with optional attributes:

Attributes:

  • show_email - Specifies if the author's email can be displayed. The default is false (0).
  • show_url - Specifies if the author's URL can be displayed. The default is true (1).
  • new_window - 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).

new_window Example code:

<$MTEntryAuthorLink new_window="1"$>

would become

<a href="http://www.sixapart.com/" target="_blank">Six Apart</a>

If no display name is specified, MTEntryAuthorDisplayName returns NULL, and no name is displayed.

Can this be spam protected?

MTEntryAuthorURL

The URL of the author.

MTEntryAuthorUsername

The username of the author.

MTEntryBasename

By default, the entry basename is a constant and unique identifier for an entry which is used as part of the individual entry's archive filename.

The basename is created by dirifiying[1] the entry title when the entry is first saved (regardless of the entry status). The system ensures that each basename is unique, even if the entry titles aren't, by adding an underscore and a number (_1, _2, ..., _10, etc) and incrementing that number until uniqueness is achieved.

From then on, barring direct manipulation, the entry basename stays constant even when you change the entry's title. In this way, Movable Type ensures that changes you make to an entry after saving it don't change the URL to the entry, subsequently breaking incoming links.

The entry basename can be modified by anyone who can edit the entry. 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.

Optional attributes
  • separator - Valid values are "_" and "-". Specifying an underscore will convert any dashes to underscores. Specifying a dash will convert any underscores to dashes.

[1] - Dirification is a process of text normalization done for the purpose of creating a consistent and predictable string. In Movable Type, this means removal of all non-ASCII characters, replacement of spaces with underscores, lowercasing of all letters, etc. See the description of the dirify global attribute for more.

MTEntryBody

This tag outputs the contents of the entry's Entry Body field. If a text formatting filter has been specified it will automatically applied.

Context: Within MTEntries block

Attributes:

  • convert_breaks - Controls the application of text formatting. By default convert_breaks is 1 (true).
  • words - Trims the number of words to display. By default all are displayed.

Related topics

MTEntryCategories

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.

Attributes:

  • glue - This attribute is a shortcut for connecting each category label with the attribute value. Single and double quotes are not permitted in the string.

MTEntryCommentCount

The number of published comments for the entry in context.

MTEntryDate

The authored on timestamp for the entry. Date format tags may be applied with the format attribute along with the language attribute. See Chapter C: Date Formats.

MTEntryExcerpt

This tag outputs the contents of the Entry Excerpt field if one is specified or, if not, an auto-generated excerpt from the Entry Body field followed by an ellipsis ("..."). You can change the length of the auto-generated output of this tag in the weblog's general settings screen.

Context: Used within an MTEntries block

Attributes:

  • no_generate - When set to 1, the system will not auto-generate an excerpt if the excerpt field of the entry is left blank. Instead it will output nothing.
  • convert_breaks - When set to 1, the entry'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

Related topics:

MTEntryFlag

This tag can be used to determine the value of one of the entry's binary options.

Output:

  • 0 - Option is off
  • 1 - Option is on

Attributes:

  • flag - A required attribute that specifies a field to evaluate. Recognized values are convert_breaks and allow_comments.

Example:

<MTIfNonEmpty tag="EntryFlag" flag="allow_comments">
    Comments are turned on for this entry
</MTIfNonEmpty>

Related topics:

MTEntryID

The numeric system ID of this entry.

Attributes:

  • pad - Adds leading zeros to create a 6 character string. The default is 0 (false). This is equivalent to using the zero_pad global filter with a value of 6.

MTEntryIfExtended

A conditional tag that displays its contents if the Extended Entry field has been defined.

MTEntryIfTagged

A conditional block which outputs its content if the entry in context has any entry tags defined. Optional Attributes:

  • tag - Allows a user to specify a particular tag to test.

Example code

The following iterates over MTEntries and, for any entries which have non-private tags assigned, prints out the entry title and all of the non-private tags that are assigned to the entry (glued together by a comma and a space)

<MTEntries>

    <MTEntryIfTagged>
        The entry "<$MTEntryTitle$>" is tagged: 
           <MTEntryTags glue=", "><$MTTagName$></MTEntryTags>
    </MTEntryIfTagged>
</MTEntries>

The following prints out the entry title for each entry in the MTEntries loop as well as an "Important" icon when the entry is tagged "Important":

    <MTEntries>
        <MTEntryIfTagged tag="Important">
            <img src="important.gif" alt="Important"/>
        </MTEntryIfTagged>

        <$MTEntryTitle>
    </MTEntries>

Like with all conditional blocks, you can use MTElse to handle the inverse situation. In the example below case, something is printed for each entry returned by MTEntries. If there are tags assigned to the entry, the output is the same as in the first example. If not, the entry title is printed along with a message indicating there are no tags.

<MTEntries>

    The entry "<$MTEntryTitle$>"
        <MTEntryIfTagged>
            is tagged: <MTEntryTags glue=", "><$MTTagName$></MTEntryTags>
        <MTElse>
            has no entry tags.
        </MTElse>

        </MTEntryIfTagged>
</MTEntries>

Naturally, you can also nest MTEntryIfTagged blocks to test for multiple individual tags or to test for a particular tag first and then for the presence of any tag.

Below is a complex example demonstrating multiple nested blocks and use of MTElse. It displays one of four images next to each entry title based on whether something is tagged "important" and then additionally tagged additionally "feature" or "bug":

<MTEntries>
    <MTEntryIfTagged tag="Important">
        <MTEntryIfTagged tag="Feature">
            <img src="important_feature.gif" alt="Important feature"/>
        <MTElse>
            <MTEntryIfTagged tag="Bug">

                <img src="important_bug.gif" alt="Important bug"/>
            <MTElse>
                <img src="important.gif" alt="Important"/>
            </MTElse>
            </MTEntryIfTagged>
        </MTElse>

        </MTEntryIfTagged>
    <MTElse>
        <img src="not_important.gif" alt="Not important"/>
    </MTElse>
    </MTEntryIfTagged>
    <$MTEntryTitle>

</MTEntries>

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTEntryKeywords

The specified keywords of the entry.

MTEntryLink

An absolute URL pointing to an archive page containing this entry. By default the tag will generate a URL to the preferred archive type specified in the weblog's Publishing Settings.

Attributes:

  • archive_type - Overrides the default behavior with a different archive type. Recognized values are "Category," "Monthly," "Weekly," "Daily," and "Individual."

For an entry's permalink see MTEntryPermalink.

MTEntryModifiedDate

The last modified date and time for the entry. Date format tags may be applied with the format attribute along with the language attribute. See Chapter C: Date Formats: Date formats.

MTEntryMore

The contents of the extended/more entry content. If any text formatting has been specified it will automatically applied.

Attributes:

  • convert_breaks - Controls the application of text formatting. By default convert_breaks is 1 (true).

MTEntryNext

A container tag that creates a context to the next entry after the one in context.

MTEntryPermalink

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.

MTEntryPrevious

A container tag that creates a context to the previous entry before the one in context.

MTEntryStatus

Displays the status of an entry. The returned value should be either "Unpublished," "Published," or "Scheduled." This tag is used primarily in creating entry exports.

MTEntryTags

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

Optional attributes

  • glue - A text string that is used to join each of the items together. For example
    <MTEntryTags glue=", "><$MTTagName$></MTEntryTags>
    would print out each tag name separated by a comma and a space.

Example code

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

<MTEntries>

    The entry "<$MTEntryTitle$>" is tagged:
        <MTEntryTags glue=", "><$MTTagName$></MTEntryTags>
</MTEntries>

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

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTEntryTitle

The title of the entry in context.

MTEntryTrackbackCount

The number of published TrackBack pings for the entry.

MTEntryTrackbackData

Outputs the machine-readable TrackBack RDF for "pinging" corresponding to the entry.

MTEntryTrackbackID

If TrackBack pings are allowed, the numeric ID of the TrackBack item corresponding to this entry.

MTEntryTrackbackLink

If TrackBack pings are allowed, the TrackBack ping URL.

Search // 14 Tags

MTBlogResultFooter

The contents of this container tag will be displayed when the last entry listed by a MTSearchResults tagset is reached. This tag is only recognized in search templates.

MTBlogResultHeader

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

This tag is only recognized in search templates.

MTEntryEditLink

A link to edit the entry in context from the Movable Type CMS. This tag is only recognized in search templates.

MTGoogleSearch

Creates the search context by using the Google API to obtain results for a particular query or for pages that are similar to a particular entry. Once retrieved, the contents of this tag are looped through for each result. The type and parameters of the search are determined by the following supported attributes.

This tag is only recognized in search templates.

Attributes:

  • excerpt - Takes a boolean value. If set to 1 (true), the excerpt of the entry in context will be used as the query.
  • keywords - Takes a boolean value. If set to 1 (true), the keywords of the entry in context will be used as the query.

Is there a limit on words???

  • query - Issues a specific search to Google.
  • related - Return results that are similar to a certain page. The value of this parameter can be a URL or 1. Passing a value of 1 will cause your Site URL to be used. (You should have set your Site URL in your Weblog configuration — if not you'll have to do so to make use of this option.)
  • results - An integer between 1 and 10 specifying the number of search results to insert.
  • title - Takes a boolean value. If set to 1 (true), the title of the entry in context will be used as the query.

The attributes query, related, title, and excerpt are mutually exclusive.

MTGoogleSearchResult

A field of an individual Google search result. This tag is used in the context of a MTGoogleSearch tagset. The tag recognizes a single required attribute.

This tag is only recognized in search templates.

Attributes:

  • property - Specifies the field of the search result to be displayed. Values can be: "summary," "URL," "snippet," or "title." The default is "title."

MTIfStraightSearch

A conditional block which outputs its contents if the search in progress is a regular (or "straight") search.

MTIfTagSearch

A conditional block which outputs its contents if the search in progress is a "tag search".

MTNoSearch

A container tag whose contents are displayed only if there is no search performed. This tag is only recognized in search templates.

MTNoSearchResults

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.

MTSearchIncludeBlogs

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.

For example:

<input type="hidden" name="IncludeBlogs" value="<$MTSearchIncludeBlogs$>" />

MTSearchResultCount

The number of results found across all of the weblogs searched. This tag is only recognized in search templates.

MTSearchResults

A container tag that creates a list of search results. This tag creates an entry and weblog context that all MTEntry* and MTBlog* tags can be used.

This tag is only recognized in search templates.

MTSearchString

An HTML-encoded search query. This tag is only recognized in search templates.

MTSearchTemplateId

Returns the identifier of the search template (ie, "feed" or "nomorepizzaplease").

System // 12 Tags

MTAdminCGIPath

Returns the value of the AdminCGIPath configuration directive if set. Otherwise the value of the CGIPath directive is returned.

MTCGIPath

The URL path to the directory containing the Movable type CGI scripts. The value of the CGIPath configuration directive.

MTCGIRelativeURL

The relative URL (path) extracted from the CGIPath setting in mt-config.cgi.

MTCommentScript

The name of the comment script. Typically mt-comments.cgi.

MTDefaultLanguage

The output of the DefaultLanguage setting in mt-config.cgi.

MTErrorMessage

This tag is used by the system to display the text of any user error message.

MTLink

Automatically generates an absolute URL to an index template or specific entry in the system. One of the following attributes are required:

Attributes:

  • template - The name of the index template.
  • entry_id - The numeric system ID of the entry.

Example:

<a href="<$MTLink template="About Page"$>">My About Page</a>

or

<a href="<$MTLink entry_id="221"$>">the entry about my vacation</a>

MTPublishCharset

The value of the PublishCharset directive in the system configuration.

MTStaticWebPath

The value of the StaticWebPath directive in the system configuration.

MTTrackbackScript

The name of the TrackBack system script. Typically mt-tb.cgi.

MTVersion

The version number of the Movable Type system.

MTXMLRPCScript

The name of the XML-RPC system script. Typically mt-xmlrpc.cgi.

Tag // 6 Tags

MTTagCount

A variable tag that provides a count of entries on the current blog that have the entry tag in context assigned to them. The tag context is created by either an MTEntryTags or an MTTags block.

Like all variable tags, you can apply any of the supported global filters to MTTagName to do further transformations.

Example code

Within an MTEntries block right before the entry byline, you might put:


<p>
    This entry has been tagged (w/ entry counts noted):
    <MTEntryTags glue=", "><$MTTagName$> (<$MTTagCount$>)</MTEntryTags>
</p>

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTTagID

A variable tag that outputs the ID of the entry tag in context. The tag context is created by either an MTEntryTags or an MTTags block.

This is not a particularly useful tag but is presented for those who, for example, might want to transfer data between installations or duplicate an installation using template tags.

Like all variable tags, you can apply any of the supported global filters to MTTagID to do further transformations.

MTTagName

A variable tag that outputs the name of the entry tag currently in context. The tag context is created by either an MTEntryTags or an MTTags block.

Optional attributes

  • quote - Adds double quotes around the any tag name which contains spaces
  • normalize - Returns the normalized version of the tag name stored in the system. The tag "Movable Type" would yield a normalized version of "movabletype".

Like all variable tags, you can apply any of the supported global filters to MTTagName to do further transformations.

Example code

The following prints out a list of tags used on a blog.

<p>
    The following tags are used on this blog: 
       <MTTags glue=", "><$MTTagName$></MTTags>
</p>

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTTagRank

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 MTEntryTags or an MTTags block.

This is suitable for creating "tag clouds" in which MTTagRank can determine what level of header (h1 - h6) to apply to the tag. Please see the important note about including tag clouds on archive pages if you are considering such a thing.

Optional attributes

  • max - Allows a user to specify the upper bound of the scale.

Example code

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">
    <MTTags>
        <h<$MTTagRank$>>

            <a href="<$MTTagSearchLink$>"><$MTTagName$></a>
        </h<$MTTagRank$>>
    </MTTags>
</div>

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTTagSearchLink

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 MTEntryTags or an MTTags block.

Like all variable tags, you can apply any of the supported global filters to MTTagSearchLink to do further transformations.

Example code

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 MTEntryTags loop


<h1>Tag cloud</h1>
<div id="tagcloud">
    <MTTags>
        <h<$MTTagRank$>>
            <a href="<$MTTagSearchLink$>"><$MTTagName$></a>

        </h<$MTTagRank$>>
    </MTTags>
</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

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

MTTags

A container tags used for listing all previously assigned entry tags for the blog in context.

Optional attributes

  • glue - A text string that is used to join each of the items together. For example <MTTags glue=", "><$MTTagName$></MTTags> would print out each tag name separated by a comma and a space.

Example code

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>
    <MTTags>
    <li>

        <a href="<$MTTagSearchLink$>"><$MTTagName$></a>
    </li>
    </MTTags>
</ul>

Using tags like MTTagRank and MTTagCount, you can make this simple code into a powerful looking and useful "tag cloud".

See the relevant section of Chapter 5.4 in the User and Administration Manual entitled "Using Template Modules" for more examples related to entry tags, including the creation of "tag clouds".

Also, please see the important performance note regarding where MTTags lists are best placed for optimum performance, also in Chapter 5.4 of the User and Administration Manual, under "Eliminating redundant publishing".

Trackback // 14 Tags

MTIfPingsAccepted

Conditional tag that displays its contents if TrackBack pings are enabled for the entry in context.

MTIfPingsActive

Conditional tag that displays its contents if TrackBack pings are enabled or pings exist for the entry in context.

MTIfPingsModerated

If the blog in context moderates pings, the block is processed. If not, the Else block is processed.

In the Weblog Settings » Trackbacks » Moderation (Basic)

or

in the Weblog Settings » Feedback » Trackbacks » Moderation (Detailed)

MTPingBlogName

The site name that sent the TrackBack ping.

MTPingDate

The timestamp of when the comment was submitted. Date format tags may be applied with the format attribute along with the language attribute. See Chapter C: Date Formats.

MTPingExcerpt

An excerpt describing the URL of the ping sent.

MTPingID

A numeric system ID of the TrackBack ping.

MTPingIP

The IP (Internet Protocol) network address the TrackBack ping was sent from.

MTPingTitle

The title of the remote resource that the TrackBack ping sent.

MTPingURL

The URL of the remote resource that the TrackBack ping sent.

MTPings

A context-sensitive container tag that lists all of the pings sent to a particular entry, category or weblog. 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 weblog context is assumed and all associated pings are listed.

MTComments requires a lastn attribute when used in a weblog context. Is that NOT the case with MTPings?

Attributes:

  • category - This attribute creates a specific category context regardless of its placement.
  • lastn - Display the last N pings in context. N is a positive integer.
  • sort_order - Specifies the sort order. Recognized values are "ascend" (default) and "descend."

MTPingsHeader

The contents of this container tag will be displayed when the first ping listed by a MTPings tagset is reached.

MTPingsSent

A container tag representing a list of TrackBack pings sent from an entry.

MTPingsSentURL

The URL of the TrackBack ping was sent to. This is the TrackBack Ping URL and not a permalink.

Utility // 19 Tags

MTDate

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

MTElse

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

MTGetVar

Displays the current value of a variable set by MTSetVar.

Attributes:

  • name - The name of the variable.

MTIfNeedEmail

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

MTIfNonEmpty

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

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

Attributes:

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

Other attributes are possible. See third example below.

Examples:

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

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

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

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

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

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

<$MTEntryTitle remove_html="1"$>

you do the following:

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

Related topics:

MTIfRegistrationAllowed

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

MTIfRegistrationNotRequired

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

MTIfRegistrationRequired

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

MTIfTypeKeyToken

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

MTIfUnregistered

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

MTIgnore

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

Example code:

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

MTImageHeight

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

MTImageURL

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

MTImageWidth

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

MTInclude

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

Attributes:

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

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

MTRemoteSignInLink

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

MTRemoteSignOutLink

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

MTSignOffURL

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