Post Tags
Post tags display information about your weblog posts.
Container Tags
- MTEntries:
<MTEntries>
- A container tag representing a list of the posts in your weblog.
This is the primary tag to use whenever you want to display your weblog posts, whether on your main index page, your date-based 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.
<MTEntries lastn="10">
<p><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></p>
</MTEntries>
This will display the 10 most recent posts in the weblog as a list of the post titles, each one linked to the post in the archives.
lastn
What: displays a specified number of the most recent posts
Usage: lastn="10"
offset
What: used with lastn, it starts the count by the offset amount, for instance to count ten posts starting ten posts back
Usage: offset="10"
days
What: displays posts from a specified number of the most recent days
Usage: days="10"
category
What: displays posts from a specified category, where Category is the name of the category
Usage: category="Category"
author
What: displays posts from a specified author, where username is the login name of the author
Usage: author="username"
sort_by
What: sorts posts for display by a field, where the options are title, status, modified_on, author_id, and excerpt
Usage: sort_by="title"
sort_order
What: sets the display order, where the options are ascend and descend
Usage: sort_order="ascend
- MTEntryIfExtended:
<MTEntryIfExtended>
- A container tag that will display its contents if the post has content in the post continuation field.
<MTEntryIfExtended>
<p class="extended"><a href="<$MTEntryPermalink$>#more"><$MTTrans phrase="Continue reading"$> "<$MTEntryTitle$>"</a></p>
</MTEntryIfExtended>
- MTEntryIfAllowComments:
<MTEntryIfAllowComments>
- A container tag that will display its contents if the post has the allow comments option turned on, used to display information about the comments.
- MTEntryIfAllowPings:
<MTEntryIfAllowPings>
- A container tag that will display its contents if the post has the accept trackbacks option turned on, used to display information about the trackback pings.
- MTEntryNext:
<MTEntryNext>
- A container tag that changes the context to the next post, used on Individual archives to create navigation links.
<MTEntryNext>
| <a href="<$MTEntryPermalink$>"><$MTEntryTitle$> »</a>
</MTEntryNext>
- MTEntryPrevious:
<MTEntryPrevious>
- A container tag similar to MTEntryNext, except that it changes the context to the previous post.
<MTEntryPrevious>
<a href="<$MTEntryPermalink$>">« <$MTEntryTitle$></a> |
</MTEntryPrevious>
- MTDateHeader:
<MTDateHeader>
- A container tag that will display its contents if the post marks a new day in the list of posts.
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date="1"$></h2>
</MTDateHeader>
- MTDateFooter:
<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.
- MTEntriesHeader:
<MTEntriesHeader>
- A container tag that will display its contents if the post is the first one in the listing.
- MTEntriesFooter:
<MTEntriesFooter>
- A container tag that will display its contents if the post is the last one in the listing.
- MTWeblogPostIfShow:
<MTWeblogPostIfShow>
- A container tag that will display its contents if a specified field is set to be displayed, such as the post title.
<MTWeblogPostIfShow field="post_title">
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>
Variable Tags
- MTEntryTrackbackData:
<$MTEntryTrackbackData$>
- adds invisible code to the post so that it can accept trackback pings.
- MTEntryDate:
<$MTEntryDate$>
- the date the post was created.
- MTEntryID:
<$MTEntryDate$>
- the unique ID for the post.
- MTEntryBody:
<$MTEntryBody$>
- the content of the post.
- MTEntryPermalink:
<$MTEntryPermalink$>
- a permanent link to the post in your archives that people can use to link to it.
- MTEntryCommentCount:
<$MTEntryCommentCount$>
- the number of comments on this post.
- MTEntryTrackbackCount:
<$MTEntryTrackbackCount$>
- the number of trackback pings sent to the post.
- MTEntryLink:
<$MTEntryLink$>
- similar to MTEntryPermalink.
- MTEntryTitle:
<$MTEntryTitle$>
- the title of the post.
- MTEntryDateModified:
<$MTEntryDateModified$>
- if the post was edited after being created, the date it was last modified.
- MTEntryExcerpt:
<$MTEntryDate$>
- an excerpt of the post.
- MTEntryAuthor:
<$MTEntryAuthor$>
- the author of the post.
- MTEntryAtomContent:
<$MTEntryAtomContent$>
- the content of the post, in the format needed in an Atom feed.
- MTEntryMore:
<$MTEntryMore$>
- the extended post or post continuation.
- MTEntryTrackbackLink:
<$MTEntryTrackbackLink$>
- the trackback URL that people can use to ping the post.
- MTEntryAuthorEmail:
<$MTEntryAuthorEmail$>
- the email address of the author of the post.
- MTEntryAuthorURL:
<$MTEntryAuthorURL$>
- the web address for the author of the post.
- MTEntryAuthorLink:
<$MTEntryAuthorLink$>
- the name of the author of the post, linked to their web address if available and otherwise to their email address.
- MTEntryAuthorNickname:
<$MTEntryAuthorNickname$>
- the nickname of the author of the post, which is set on the author profile page.
- MTEntryKeywords:
<$MTEntryKeywords$>
- keywords for the post.
- MTEntryPermalinkRelative:
<$MTEntryPermalinkRelative$>
- similar to MTEntryPermalink but as a relative path rather than a URL.
- MTEntryStatus:
<$MTEntryStatus$>
- the publication status of the post, Draft, Publish, or Future.
Examples
The default code to display posts on the main page of your weblog, and can be used on date-based and category archive pages as well:
<MTEntries>
<$MTEntryTrackbackData$>
<MTWeblogPostIfShow field="date_header">
<MTDateHeader>
<h2><$MTEntryDate format_weblog_date="1"$></h2>
</MTDateHeader>
</MTWeblogPostIfShow>
<a id="a<$MTEntryID pad="1"$>"></a>
<MTWeblogPostIfShow field="post_title">
<h3><$MTEntryTitle$></h3>
</MTWeblogPostIfShow>
<$MTEntryBody$>
<MTEntryIfExtended>
<p class="extended"><a href="<$MTEntryPermalink$>#more"><$MTTrans phrase="Continue reading"$> "<$MTEntryTitle$>"</a></p>
</MTEntryIfExtended>
<p class="posted">
<$MTEntryDate format="%B %e, %Y"$> <MTEntryIfCategories>in <MTEntryCategories glue=", "><MTBlogIfArchives archive_type="Category"><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a>
<MTElse><$MTCategoryLabel$></MTElse>
</MTBlogIfArchives></MTEntryCategories></MTEntryIfCategories> | <a href="<$MTEntryPermalink$>">Permalink</a> <MTEntryIfAllowComments> | <a href="<$MTEntryPermalink$>#comments"><$MTTrans phrase="Comments"$> (<$MTEntryCommentCount$>)</a> </MTEntryIfAllowComments> <MTEntryIfAllowPings> | <a href="<$MTEntryPermalink$>#trackback"><$MTTrans phrase="TrackBack"$> (<$MTEntryTrackbackCount$>)</a> </MTEntryIfAllowPings> </p>
</MTEntries>
The default code to display a listing of the ten most recent posts, typically placed in a sidebar:
<h2><$MTTrans phrase="Recent Posts"$></h2> <ul>
<MTEntries lastn="10">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle remove_html="1" generate="1"$></a></li>
</MTEntries>
</ul>
Copyright © 2003-2005 Six Apart