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 Chapter 8 in the Users and Administrators Guide entitled "Customizing Your Published Weblogs" for more examples related to entry tags, including the creation of "tag clouds".
You can download the Users and Administrators Guide here.
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.
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 spacesnormalize - 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 Chapter 8 in the Users and Administrators Guide entitled "Customizing Your Published Weblogs" for more examples related to entry tags, including the creation of "tag clouds".
You can download the Users and Administrators Guide here.
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 Chapter 8 in the Users and Administrators Guide entitled "Customizing Your Published Weblogs" for more examples related to entry tags, including the creation of "tag clouds".
You can download the Users and Administrators Guide here.
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 Chapter 8 in the Users and Administrators Guide entitled "Customizing Your Published Weblogs" for more examples related to entry tags, including the creation of "tag clouds".
You can download the Users and Administrators Guide here.
A container tags used for listing all previously assigned entry tags for the blog in context.
Attributes
sort_by - Specifies the attribute on which to sort the select tag list. Recognized values are "id", "name" and "count." The default is "name." sort_order - Specifies the order by which to sort the selected tags. Recognized values are "ascend" and "descend." The default is "descend." limit - Limits the number of selected tags that are returned to the specified value. Recognized values are positive integers. The default is not to limit the selection. These allow you to select a subset of a blog's tags when using the MTTags template element. All three attributes are optional.
Example code
To display the first 100 entry tags created on a weblog with oldest first:
<MTTags sort_by="id" sort_order="ascend" limit="100"> ... </MTTags>
To display the latest 100 entry tags created on a weblog with most recent first:
<MTTags sort_by="id" sort_order="descend" limit="100"> ... </MTTags>
To display most used 100 entry on a weblog from the most to least user:
<MTTags sort_by="count" sort_order="descend" limit="100"> ... </MTTags>
Note
Some users may want to select the N most used tags on a weblog but sort them by name, id or something other than the count. This cannot be done purely with template tags but could be done either with PHP or a sorting plugin.
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 Chapter 8 in the Users and Administrators Guide entitled "Customizing Your Published Weblogs" for more examples related to entry tags, including the creation of "tag clouds".
You can download the Users and Administrators Guide here.