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.
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".
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 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".
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".
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".
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".