This page documents the TypePad template tags used by Advanced Template designs. You can learn more about Advanced Templates and template tag syntax in the TypePad Knowledge Base.
Archive
Archive tags display information about your blog archives.
See also…
MTArchiveCategory
The category of the archive; this only makes sense if you have enabled Category Archiving for your blog.
MTArchiveCount
The number of posts in a given date-based archive.
MTArchiveDate
The date of a date-based archive. For weekly archives, this gives the start date.
MTArchiveDateEnd
The end date of a weekly archive.
MTArchiveHasHeader
A container tag that displays a header in category and date based archives.
MTArchiveHeader
The label for the archive header.
MTArchiveLink
The URL of the archive that is being linked to.
MTArchiveList
A container tag representing a list of the archives in your blog. Takes attribute archive_type
to specify which set of archives to link to. This takes the values Monthly, Weekly, Daily, Category.
MTArchiveNext
A container tag similar to MTArchivePrevious
, except that it changes the context to the next archive.
MTArchivePrevious
A container tag that changes the context to the previous archive. This is used on your archive templates to create navigation links.
MTArchiveTitle
The title of the archive.
Blog
Blog tags display information about your blog. Most of these options are set on the Configure tab, or when you created your account or blog.
MTBlogArchiveURL
Your blog archive URL, in the form: http://example.typepad.com/blog/
MTBlogCommentCount
The number of comments posted to your blog.
MTBlogDescription
Your blog description.
MTBlogDirname
Your blog directory, in the form: blog
MTBlogEntryCount
The number of posts in your blog.
MTBlogHost
Your blog hostname, in the form: example.typepad.com
MTBlogID
Your blog ID number.
MTBlogIfAllowFavorites
A container tag that only displays its contents if favorites are enabled for your blog.
MTBlogIfAllowReblogs
A container tag that only displays its contents if reblogs are enabled for your blog.
MTBlogIfArchives
A container tag that only displays its contents if archives are enabled for your blog. This prevents an empty archive list from being displayed if you do not have archives. Takes attribute archive_type
to specify which set of archives to link to. This takes the values Monthly, Weekly, Daily, and Category.
MTBlogIfDescription
Conditional container tag used around MTBlogDescription
so that it only displays if a description is set for the blog on Blog → Settings → Basics.
MTBlogIfPrivate
If your blog is set to not be public, the contents of this container tag will be displayed.
MTBlogLanguage
Your blog language.
MTBlogMetaDescription
Your blog’s meta description.
MTBlogMetaKeywords
Your blog’s meta keywords.
MTBlogName
Your blog name.
MTBlogRelativeURL
Your blog’s relative URL, in the form: /blog/
MTBlogSitePath
Your blog site path, in the form: blog/
MTBlogURL
Your blog URL, in the form: http://example.typepad.com/blog/
MTWeblogIfCommentsModerated
Use in Individual Archive template comment form around elements only shown if comment moderation turned on. Takes setting from Blog → Settings → Comments.
MTWeblogIfExposeTags
A conditional container tag used to check if Technorati Tags are enabled on a blog; see below for other tags.
MTWeblogIfFullRSSContent
Container tag used in Atom feed around MTEntryAtomContent
and in RSS feed around MTEntryBody
and MTEntryMore
. Takes setting from Blog → Settings → Feeds.
See the sample below for information on how to use this tag.
MTWeblogIfRegistrationEnabled
Use in Individual Archive template comment form around elements only shown if comment authentication turned on (optional or required). Takes setting from Blog → Settings → Comments.
MTWeblogIfRegistrationRequired
Use in Individual Archive template comment form around elements only shown if comment authentication is required. Takes setting from Blog → Settings → Comments.
MTWeblogOwnerHas
Use with field="feeds_full_content"
around MTWeblogIfFullRSSContent
and around MTEntryBody
and MTEntryMore
; takes setting from Blog → Settings → Feeds.
MTWeblogPortalURL
The link to portal for TypePad in Powered By link.
MTWeblogPostIfShow
A container tag that will display its contents if a specified field is set to be displayed, such as the post title. Takes attribute field which specifies the post field to check if it is set on Blog → Design → Content to be displayed. This takes the values date_header
and post_title
.
Calendar
Calendar tags display the sidebar calendar on your blog.
It is possible to list multiple recent calendars:
N
is the number of recent calendars to display. Note the use of MTArchiveList
container and that MTArchiveDate
is used instead of MTDate
in the caption. It is currently not possible in TypePad to display a calendar from a specified month, only one or more recent calendars.
MTCalendar
A container tag that holds the other calendar tags.
MTCalendarDay
Displays the date (day of the month) on the calendar.
MTCalendarIfBlank
A container tag that creates the structure for blank spaces on the calendar.
MTCalendarIfEntries
A container tag that displays its contents if there was a blog post on that day.
MTCalendarIfNoEntries
A container tag that displays its contents if there were not blog posts on that day.
MTCalendarIfToday
A container tag that displays its contents if the date on the calendar is the same as the date the blog was last published.
MTCalendarWeekDay
Displays the calendar header for each day of the week.
MTCalendarWeekDays
A container tag that cycles through the days of the week to create the calendar headers.
MTCalendarWeekFooter
A container tag that creates the calendar structure.
MTCalendarWeekHeader
A container tag that creates the calendar structure.
Category
Category tags display information about your blog categories.
Display a list of the categories:
See also…
MTCategories
A container tag representing a list of the categories in your blog. For each category, you can use any of the tag variables below; in addition, you can use an MTEntries
tag to display information about each of the entries in this category. Categories will be listed in alphabetical order and there isn’t another option for their display.
This tag will return at most 300 categories. If your blog has more categories than this, it will return the 300 most commonly-used categories.
When a category does not contain any posts, by default that category will not be included in the list of categories; this is the default behavior because it mirrors the behavior of MTArchiveList
. Note that this is advised if you are including links to your category archive pages, because archive pages are not generated for empty categories. Thus, the archive link for an empty category will be a broken link.
If you would like to override this default behavior, you can provide this tag with the show_empty
attribute. For example, this will display a list of all of your categories, even those that are empty:
MTCategoryArchiveLink
A link to the archive page for this category. This only works if you have enabled Category Archiving for your blog; if you have not, you will get an error message when rebuilding your pages.
MTCategoryCount
The number of posts in this category.
MTCategoryID
Deprecated. Apply the dirify
attribute to MTCategoryLabel
if you need a category ID.
<$MTCategoryLabel dirify="1"$>
MTCategoryLabel
The category label.
Comment
Comment tags display the comments posted by visitors to your blog.
Display a list of recent comments on the blog, for your sidebar:
Display the comments form:
See also…
MTCommentAuthor
The name of the comment author.
MTCommentAuthorLink
The name of the comment author, linked to their URL if they submitted one, otherwise to their email address. Takes attribute spam_protect
which will encode the contents against spam harvesters using the values 0 (no spam protection) and 1 (spam protection). Takes attribute show_email
to indicate whether the email address will be displayed if no URL is entered for the comment author using the values 0 (email address is never displayed) and 1 (email address will be displayed if no URL entered).
MTCommentAuthorPhoto
The URL for the comment author’s photo (aka userpic or avatar).
MTCommentBody
The text of the comment.
MTCommentDate
The date that the comment was posted, can be formatted with date and time tags.
MTCommentEmail
The email address of the comment author. Takes attribute spam_protect
which will encode the contents against spam harvesters using the values 0 (no spam protection) and 1 (spam protection).
MTCommentEntry
A container tag used to display information about the post to which the comment is attached; you can use Post Tags here. Note that the MTCommentDate
tag must be used outside of this container or it will display the post date instead of the comment date.
MTCommentID
The numeric ID of the comment.
MTCommentOrderNumber
The numeric order of a particular comment in the list of comments for an entry, starting at 1. Note that the order is dependent on the sort order (ascending or descending).
MTCommentPermalink
A permanent link to an individual comment on a post.
Benefits:
Redirects to the right page if the comment is on a post with several pages of comments.
Jumps to the comment anchor on the page.
Provides a shorter (and future-proof) way of writing:
<$MTEntryPermalink$>?cid=<$MTCommentID$>#comment-<$MTCommentID$>
MTComments
A container tag representing a list of the comments posted by visitors to your blog. For each comment, you can use any of the tag variables below.
The MTComments
tag is located in the comment-list module within the entry-individual module in the Individual Entry Archives template.
Note: Using the MTComments
tag in an advanced template without a lastn
value and outside the context of an entry, will default to showing only 50 comments from the last 30 days instead of all comments.
MTCommentURL
The URL submitted by the comment author, if one was.
Gallery
MTGalleriesInclude
The MTGalleriesInclude
tag displays a list of your photo albums in an advanced template. This listing will display a thumbnail image for each album that links to that photo album. The thumbnail is of the most recent image uploaded to that album.
This tag will create a display that is the same as the one you see in basic templates.
Related
If you would like display individual Photo Albums in your sidebar, you can use include tags in the following format:
<!--#include virtual="/photos/my_album/module.inc"-->
where “my_album” is the name of the Photo Album.
You can find the name and format of each Photo Album under the Photo Albums tab. Each Photo Album displays the published location of an album in the format of:
http://example.typepad.com/photos/my_album/
Include
MTInclude
Includes a template module and outputs the result.
Attributes
module
: The name of the template module to include.<$MTInclude module="Module Name"$>
Page
MTPageBody
The body of the page.
MTPageDate
The date the page was published. Can be formatted with date and time tags.
MTEntryDateModified
If the post was edited after being created, the date it was last modified.
MTPageFilename
The file path to the page.
<a href="<$MTBlogURL$><$MTPageFilename$>"><$MTPageTitle remove_html="1"$></a>
MTPages
Container tag used for listing links to the pages associated with a blog.
MTPageSidebarModuleTitle
Used as a header in a sidebar listing of links to each page, default is “Pages”.
Sidebar listing to each page associated with a blog:
MTPageTitle
The title of the page.
Entry
Entry tags display information about your blog posts.
Simple code to display posts on the main page of your blog, and can be used on date-based and category archive pages as well:
The default code to display a listing of the ten most recent posts in a sidebar:
See also…
MTDateFooter
A container tag that will display its contents if the post is the last one in a given day in the list of posts. This must be used within the MTEntries
container.
MTDateHeader
A container tag that will display its contents if the post marks a new day in the list of posts. This must be used within the MTEntries
container.
MTEntries
A container tag representing a list of the posts in your blog.
This is the primary tag to use whenever you want to display your blog posts, whether on your Main Index page, your DateBased or Category archives, or a listing on your sidebar. The MTEntries tag can take attributes that specify which posts to display and what order to display them in.
This will display the 10 most recent posts in the blog as a list of the post titles, each one linked to the post in the archives.
Attributes
lastn
: Displays a specified number of the most recent posts, as long as the posts are within the last 30 days; otherwise, displays as many of the posts as are within 30 days. (lastn="10"
)offset
: Used with lastn, it starts the count by the offset amount, for instance to count ten posts starting ten posts back. (offset="10"
)category
: Displays posts from a specified category, whereCategory
is the name of the category. (category="Category"
)author
: Displays posts from a specified author, whereusername
oremail
is the login name or primary email of the author. (author="username"
,author="email"
) Does not work in combination withcategory
; if both are used, the category search will take precedence.sort_by
: Sorts posts for display by a field, where the options aretitle
ormodified_on
. (sort_by="title"
)sort_order
: Sets the display order, where the options areascend
anddescend
. (sort_order="ascend"
)no_featured_post
: Displays posts, without any post you’ve marked as “featured”. (no_featured_post="1"
)
MTEntriesFooter
A container tag that will display its contents if the post is the last one in the listing. This must be used within the MTEntries
container.
MTEntriesHeader
A container tag that will display its contents if the post is the first one in the listing. This must be used within the MTEntries
container.
MTEntryAtomContent
The body and extended body of the post, formatted for use in Atom feeds.
MTEntryAuthor
The author of the post.
MTEntryAuthorEmail
The email address of the author of the post. Takes attribute spam_protect
, which will encode the contents against spam harvesters. This takes the values 0 (no spam protection) and 1 (spam protection).
MTEntryAuthorID
The post author’s unique TypePad ID.
MTEntryAuthorLink
The name of the author of the post, linked to their web address if available and otherwise to their email address. Takes attribute spam_protect
, which will encode the contents against spam harvesters. This takes the values 0 (no spam protection) and 1 (spam protection).
MTEntryAuthorNickname
The nickname of the author of the post, which is set on the author profile page.
MTEntryAuthorPhotoURL
The web address for the post author’s photo.
<$MTEntryAuthorPhotoURL size="50si"$>
MTEntryAuthorProfileURL
The web address for the post author’s TypePad profile.
MTEntryAuthorURL
The web address for the author of the post.
MTEntryBody
The content of the post.
MTEntryCategories
A container tag that loops through each of the post’s categories and displays information about them.
For example, this will display a list of all the categories that a post is assigned to:
MTEntryCommentCount
The number of comments on this post.
MTEntryDate
The date the post was created, can be formatted with date and time tags.
MTEntryEnclosureLength
Used in RSS 2.0 template inside MTEntryEnclosures
to produce file size of enclosure, required for podcasting.
MTEntryEnclosureMIMEType
Used in RSS 2.0 template inside MTEntryEnclosures
to produce MIME type of file required for podcasting.
MTEntryEnclosures
Used in RSS 2.0 feed to list enclosures for each post; contains other tags.
MTEntryEnclosureURL
Used in RSS 2.0 template inside MTEntryEnclosures
to produce URL of enclosed file.
MTEntryExcerpt
An excerpt of the post.
MTEntryFavoriteCount
The number of times the post has been marked as a favorite.
MTEntryReblogCount
The number of times the post has been reblogged.
MTEntryFavoriteLink
The button for marking a post as a favorite.
MTEntryReblogLink
The button for reblogging the post.
MTEntryID
The unique ID for the post.
MTEntryIfAllowComments
A container tag that will display its contents if the post allows comments.
In the Main Index, DateBased Archives, and Category Archives templates, the MTEntryIfAllowComments
tag is used to in the entry-list module to display links to the comment posting form on the individual post page.
In the Individual Entry Archive template, the MTEntryIfAllowComments
tag is used to display the comment posting form.
MTEntryIfAllowPings
A container tag that will display its contents if the post allows TrackBacks.
MTEntryIfCategories
A conditional container tag that will only display its contents if the blog post is assigned to one or more categories.
If you have some code that you would like to display only if the post is assigned to a category — such as category information — then wrap the code in MTEntryIfCategories
container tags.
MTEntryIfCommentsOpen
A container tag whose contents will only be shown if the comment setting for the post is Open and is used to display the comment posting form. The MTEntryIfCommentsOpen
tag is located in the comment-form module within the entry-individual module in the Individual Entry Archives template.
MTEntryIfExtended
A container tag that will display its contents if the post has content in the post continuation field.
MTEntryIfFavorited
A container tag that will display its contents if the post has been marked as a favorite.
MTEntryIfReblogged
A container tag that will display its contents if the post has been reblogged.
MTEntryIfTagged
A conditional container tag used to check if Technorati Tags are used in a post. See below for other tags.
MTEntryIfViewerHasFavorited
A container tag that will display its contents if the current user has marked the post as a favorite.
MTEntryKeywords
Keywords for the post.
MTEntryLink
Similar to MTEntryPermalink.
MTEntryMore
The extended post or post continuation.
MTEntryNext
A container tag that changes the context to the next post, used on Individual archives to create navigation links.
MTEntryPermalink
A permanent link to the post in your archives that people can use to link to it. Takes attribute archive_type
to specify which set of archives to link to. This takes the values Monthly
, Weekly
, Daily
, Category
, Individual
and combinations; e.g. Monthly|Daily|Weekly
.
MTEntryPermalinkRelative
Similar to MTEntryPermalink
but as a relative path rather than a URL.
MTEntryPhoto
A container tag that represents the Photo referred to by the first <img>
tag in the post. The contents of the container tag will be ignored if there aren’t any Photos in the post (note that a Photo
refers to an image uploaded to and served from TypePad, not an image linked externally).
You can use MTEntryPhotoURL
inside of this container tag to reference the full URL for the photo (or any of the supported sizes, using the spec
attribute). For example:
MTEntryPhotoURL
The URL for the photo represented by MTEntryPhoto
, to be used inside of the MTEntryPhoto
container tag. See the documentation for that tag for example usage.
This tag takes the optional attribute spec
, which allows you to specify the size of the photo that you’d like the URL for; the default, if spec
is unspecified, is the full size original photo. See the documentation for all supported sizes.
MTEntryPostFooter
Displays the Post Footer set in Blog → Design → Content → Post Footer. To modify, replace with the following code, than make desired changes.
MTEntryPrevious
A container tag similar to MTEntryNext
, except that it changes the context to the previous post.
MTEntrySignInURL
Used in Individual Archive template comments form to produce TypeKey sign-in link.
MTEntrySignOutURL
Used in Individual Archive comments form to produce TypeKey sign-out link.
MTEntryStatus
The publication status of the post, Draft, Publish, or Future.
MTEntryTags
A container tag used to display each Technorati Tag in a post.
MTEntryTitle
The title of the post. Takes attribute generate
which will generate a title from the first characters of the post if no title is set by the user. This takes the values 0 (no title generated) and 1 (title generated).
MTEntryTrackbackCount
The number of TrackBacks sent to the post.
MTEntryTrackbackData
Adds invisible code to the post so that it can accept TrackBacks.
MTEntryTrackbackLink
The TrackBack URL that people can use to send a TrackBack to the post.
MTTagLabel
A tag used to display a particular Technorati Tag or label.
MTTagLabelClean
A tag used to encode content in a Technorati Tag.
TrackBack
TrackBack tags display TrackBacks sent to your blog. These tags can be used in main index templates as well as archive templates.
MTPingBlogName
The name of the blog that sent the TrackBack.
MTPingDate
The date that the TrackBack was sent, can be formatted with date and time tags.
MTPingExcerpt
An excerpt of the post that sent the TrackBack.
MTPingID
The numeric ID of the TrackBack.
MTPingIP
The IP address that the TrackBack was sent from.
MTPings
A container tag representing a list of the TrackBacks sent to your blog. For each TrackBack, you can use any of the tag variables below.
MTPingsSent
A container tag representing a list of the TrackBacks that you have sent.
MTPingsSentURL
The URL of the post that you sent a TrackBack to.
MTPingTitle
The title of the post that sent the TrackBack.
MTPingURL
The URL of the post that sent the TrackBack.
TypeList
The TypeList tags are for displaying data from your TypeLists.
MTList
These tags give you full control of the TypeList display. The MTList
container loops through the list items and displays each using the MTListItem
tag.
Use the name
to specify the TypeList to display:
MTListInclude
The MTListInclude
tag displays your TypeLists as pre-formatted html code blocks in an advanced template. The list items are enclosed automatically in <li>list item</li>
markup and the display of the list is set in the advanced configuration for the TypeList.
Use the name
attribute to specify the TypeList to display:
<$MTListInclude name="TypeList Name"$>
The TypeList Name
is the name you gave the TypeList and is set in the configuration for the TypeList. The name is case sensitive so use it in the tag exactly as it is entered in the TypeList configuration.
You can also use the MTUserLists
container to include all of the lists that you have selected to display on your About Page. The name
attribute is not used, the MTListInclude
tag is surrounded by the MTUserLists
container instead:
MTListItem
MTListItem Fields
Use field
with the MTListItem
tag to specify the field that you would like to display from the TypeList. Each list type (People, Link, Reading, Music) has its own set of valid fields:
People TypeList
- Name:
<$MTListItem field="name"$>
- Site Name:
<$MTListItem field="site_name"$>
- Homepage:
<$MTListItem field="htmlurl"$>
- Email Address:
<$MTListItem field="email"$>
- One-Line Bio:
<$MTListItem field="notes"$>
Display a list of people with the Site Name linked and the One-Line Bio as the link tooltip:
Link TypeList
- Title:
<$MTListItem field="title"$>
- URL:
<$MTListItem field="url"$>
- Notes:
<$MTListItem field="notes"$>
Display a list of links that use the link title as the link and open in a new window:
Books TypeList
- Title:
<$MTListItem field="title"$>
- Author:
<$MTListItem field="author"$>
- Notes:
<$MTListItem field="notes"$>
- Rating as 1 - 5:
<$MTListItem field="rating"$>
- Rating as *:
<$MTListItemRating$>
- ASIN:
<$MTListItem field="asin"$>
- Amazon URL:
<$MTListItemURL$>
- Amazon image:
<$MTListItemImage$>
Display a list with the thumbnail of the book, the title of the book, and the rating as stars:
Albums TypeList
- Song:
<$MTListItem field="song"$>
- Artist:
<$MTListItem field="artist"$>
- Album:
<$MTListItem field="album"$>
- Notes:
<$MTListItem field="notes"$>
- Rating as 1 - 5:
<$MTListItem field="rating"$>
- Rating as *:
<$MTListItemRating$>
- Amazon URL:
<$MTListItemURL$>
- Amazon image:
<$MTListItemImage$>
Display a text list of albums with the artist as the tooltip and also display the notes for the item:
User
The User tags are for displaying your Author Profile information.
Customizing an Advanced About Page (Pro)
Pro members have the option of selecting to use the About Page default template or using a custom About Page template. With a custom About Page template, enter the HTML and TypePad Tags in the text field to create your design. You can also use the user tags in an advanced index or archive template.
Tip: MTUserSiteURL
An About Page does not “belong” to a specific blog so it does not make sense to use the MTBlogURL
tag in an advanced About Page template. Use MTUserSiteURL
instead, adding the necessary directory information for the blog that you are referring to.
Important Note: If you’re not comfortable writing/editing HTML, you should continue using the default About Page template above.
Sample Template
When creating a custom About Page, you will need to write the HTML for the entire page. If you’re also using an Advanced Template Set, you can copy over elements from your regular blog templates and this is the easiest way to do it if you want the page to look like one of your blogs.
For the content of the page, that is, the actual profile information, you can use a format like the following:
You can add tags for other profile information that you’d like to display. The available tags are listed below.
MTUserAboutPageTitle
About page title. (Your first and last name is used for the About Page title. If Nickname but not Name is selected to display on about page, Nickname is used. If neither are selected, “About Me” is used.)
MTUserAIM
AIM name.
MTUserBio
Biography.
MTUserEmail
Email address. (automatically spam-protected as described above)
MTUserFullName
Name.
MTUserICQ
ICQ number.
MTUserIfPhoto
This is a conditional tag used around MTUserPhoto
, so that it will be displayed only if you have uploaded a profile photo.
MTUserIfShow
This tag takes the attribute field
to see if a specific field is set to be displayed on your About Page. If it is checked, then this tag will display that information. The field attribute currently takes the value FOAF
.
MTUserInterests
Interests.
MTUserLocation
Location.
MTUserMiniBio
One-line bio.
MTUserMSN
MSN Messenger.
MTUserPhoto
Profile photo URL.
MTUserPhotoHeight
Profile photo height.
MTUserPhotoWidth
Profile photo width.
MTUserPublicKey
PGP key.
MTUserPublicKeyLink
PGP key link.
MTUserSiteName
Your example.typepad.com
address.
MTUserSiteURL
Your http://example.typepad.com/
address.
MTUserStartDate
Your TypePad registration date.
MTUserURL
Web address (URL).
MTUserWishlist
Amazon Wish List.
MTUserYahoo
Yahoo! ID.
Miscellaneous
MTAtomFeedIDBase
Used in Atom feed header to provide information about the blog.
MTCGIPath
Used in <head>
section of templates to link to RSD and in Atom feed to point to Atom application, also in comments form to point to comment script.
MTElse
Container tag used with conditional tags; if the condition is not true, then the content inside MTElse
is displayed instead.
MTIfNonEmpty
Conditional container tag whose contents will display if the specified tag has content. The specified tag can be any variable tag used in the appropriate context.
MTRSDScript
Used to generate filename of the RSD script, along with MTCGIPath
.
MTStaticWebPath
Used in the comments javascript code in Individual Archive.
MTStatsScript
Used to place the code for the stats script in a template.
Trans
You can use the MTTrans
tag to add text and headers to your blog templates that will be translated if you change the blog language. For example, if you modify Permalink in your template to <$MTTrans phrase="Permalink"$>
then change your blog’s language to French, the word “Permalink” will be displayed as “Lien permanent” on the blog.
If you enter a phrase that is not supported, the text will remain in English even if the blog is set to a different language for display.
The MTTrans
tag will translate the phrases according to the display language that is set on Blog → Settings → Posts. MTTrans
only works with the languages listed as supporting display of localized headers. These are:
- Dutch
- French
- Finnish
- German
- Italian
- Spanish
Global
Global Attributes
Global attributes can be used in conjunction with other tags (like date formatting, post tags, etc.) to force case, strip HTML tags, and so on.
decode_html
Decodes all HTML entities in the tag value to their corresponding characters.
For example, a <$MTEntryBody$>
tag with the value <b>bold</b>
normally displays as <b>bold</b>
. Using <$MTEntryBody decode_html="1"$>
causes it to display as bold.
decode_xml
Decodes all XML entities in the tag value to their corresponding characters.
<$MTEntryBody decode_html="1"$>
dirify
Transforms the tag value into a format suitable for use in a file or directory name. Characters are lower-cased, non-alphanumeric characters are stripped, and whitespace characters are converted to underscores.
<$MTCategoryLabel dirify="1"$>
encode_html
Encodes special characters in the tag value into their corresponding HTML entities.
For example a <$MTEntryBody$>
tag with the value <b>bold</b>
normally displays as bold. Using <$MTEntryBody encode_html="1"$>
causes it to display as <b>bold</b>
.
encode_js
Encodes the tag value into a format suitable for use as a JavaScript string value.
<$MTEntryTitle encode_js="1"$>
encode_url
Encodes the tag value into a format suitable for use in a URL. Non-alphanumeric characters are encoded into their hexadecimal equivalents.
<$MTEntryTitle encode_url="1"$>
encode_xml
Encodes special characters in the tag value into their corresponding XML entities. These are: &
, "
, <
and >
. The difference between this and encode_html
is that the latter encodes a much wider set of special characters into HTML entities.
<$MTEntryBody encode_xml="1"$>
lower_case
Transforms the tag value into lower case characters.
<$MTArchiveDate format="%B" lower_case="1"$>
Tip: This tag is good for making AM/PM display as am/pm.
remove_html
Strips all HTML from the tag value.
<$MTEntryBody remove_html="1"$>
sanitize
Strips all HTML from the tag value except for the specified exceptions.
For example, <$MTEntryBody sanitize="em"$>
will strip all HTML except the <em>
tags.
trim_to
Trims the tag value to the first N
characters, where N
is specified as the value of the attribute.
<$MTEntryTitle trim_to="N"$>
upper_case
Transforms the tag value into upper case characters.
<$MTEntryTitle upper_case="1"$>
zero_pad
Pads the tag value with zeros so that the total length is N
characters, where N
is specified as the value of the attribute.
<$MTEntryID zero_pad="N"$>
Dates
Date formatting can be used to format dates and times in a variety of different configurations to suit your needs and preferences. You can use date formatting in conjunction with other tags such as MTEntryDate
, MTPingDate
, and MTCommentDate
.
Without a format set, the date tags default to what is set on Blog → Settings → Posts.
Format Characters
%a
: The abbreviated weekday name. Example: Thu.%A
: The full weekday name. Example: Thursday.%b
: The abbreviated month name. Example: Sep.%B
: The full month name. Example: September.%d
: The two-digit day of the month padded with leading zeroes if applicable. Example: 09.%e
: The day of the month space padded if applicable. Example: 9.%H
: The two-digit military time hour padded with a zero if applicable. Example: 16.%I
: The two-digit hour on a 12-hour clock padded with a zero if applicable. Example: 04.%j
: The three-digit day of the year padded with leading zeroes if applicable. Example: 040.%k
: The two-digit military time hour padded with a space if applicable. Example: 9.%l
: The hour on a 12-hour clock padded with a space if applicable. Example: 4.%m
: The two-digit month padded with a leading zero if applicable. Example: 09.%M
: The two-digits minute padded with a leading zero if applicable. Example: 02.%p
: Either AM or PM. Language dependent.%S
: The two-digit second padded with a zero if applicable. Example: 04.%w
: The numeric day of the week ranging from 0 to 6 where 0 is Sunday. Example: 0%x
: The language-aware standard date representation. For most languages, this is just the same as %B %d, %Y. Example: September 06, 2002. Shows same as default.%X
: The language-aware time representation. For most languages, this is just the same as %I:%M %p. Example: 04:31 PM. Shows same as default.%y
: The two-digit year padded with a leading zero if applicable. Example: 01.%Y
: The four-digit year. Example: 2006
Attributes
format
<$MTEntryDate format="%A"$>
language
Applies to weekday names (%a, %A), month names (%b, %B, and in %X), and am/pm code (%p).
<$MTEntryDate format="%A" language="fr"$>
You can set the language for date display in Blog → Settings → Posts, and this is used as the default if no language is specified for the tag.
- ar (Arabic)
- zh (Chinese)
- hr (Croatian)
- cs (Czech)
- da (Danish)
- nl (Dutch)
- en (English)
- fa (Farsi)
- fi (Finnish)
- fr (French)
- de (German)
- el (Greek)
- he (Hebrew)
- hi (Hindi)
- hu (Hungarian)
- is (Icelandic)
- id (Indonesian)
- it (Italian)
- ja (Japanese)
- ko (Korean)
- lt (Lithuanian)
- no (Norwegian)
- pl (Polish)
- pt (Portuguese)
- ru (Russian)
- ro (Romanian)
- sr (Serbian)
- sk (Slovak)
- sl (Slovenian)
- es (Spanish)
- sv (Swedish)
- th (Thai)
- tr (Turkish)
- vi (Vietnamese)
timezone
Values used: UTC, use offset in format
±hhmm
to specify other time zones.For instance, PST is GMT -8 so the offset in Perl format is
-0800
. Australian Central Daylight Time (GMT +10:30) would be+1030
.format_weblog_date
Sets the tag to use the Date Format set in Blog → Settings → Posts.
Values used: 1, 0
format_name
Value used: W3CDTF (format required for RSS feeds).