Not a developer? Go to MovableType.com

Documentation

Tags

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

Attributes

  • glue

    A text string that is used to join each of the items together. For example:

    <mt:Tags glue=", "><mt:TagName></mt:Tags>
    

    would print out each tag name separated by a comma and a space.

  • type

    The kind of object for which to show tags. By default the entry tags are shown. While any object is “taggable,” default valid values are entry, page, and asset.

  • sort_by

    The tag object column on which to order the tags. Common values are name and rank. By default tags are sorted by name.

  • sort_order

    The direction in which to sort tags by the sort_by field. Possible values are ascend and descend. By default, tags are shown in ascending order when sorted by name and descending order when sorted by other columns.

  • limit

    A number of tags to show. If given, only the first tags as ordered by sort_by and sort_order are shown.

  • top

    A number of tags to show. If given, only the given number of tags with the most uses are shown. For example:

    <mt:Tags top="20">
        <mt:TagName>
    </mt:Tags>
    

    is equivalent to

    <mt:Tags limit="20" sort_by="rank">
        <mt:TagName>
    </mt:Tags>
    

    Note that even when top is used, the tags are shown in the order specified with sort_by and sort_order.

  • include_private="0"

    Use a value of 1 to include private tags (tags starting with @). This modifier was added to Movable Type 6.0.4.

  • include_blogs

  • exclude_blogs
  • include_websites
  • exclude_websites

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>
    <mt:Tags>
    <li>
        <a href="<mt:TagSearchLink>"><mt:TagName></a>
    </li>
    </mt:Tags>
</ul>

Using tags like TagRank and TagCount and proper page styling, you can make this simple code into a powerful looking and useful “tag cloud”.

<ul>
    <mt:Tags top="20">
    <li class="rank-<mt:TagRank max="10"> widget-list-item">
        <a href="<mt:TagSearchLink>"><mt:TagName></a>
    </li>
    </mt:Tags>
</ul>
Back

2 Comments

Joshua Konkle

Joshua Konkle on March 21, 2008, 4:41 p.m. Reply

this needs an optional attribute of “name=”

The current attributes are geared to tag clouds, aka “spatially relevant” but not “sequentially” relevant.

Categories could use the same optional attribute “name=”

I don’t always want to iterate through the list, in some cases I want to work with the tagCount.

Currently there is no way to get the number of entries in a category or tag individually. Seems simple, but I’ve had a hard time figuring it out of there is a combo of other blocks and attributes.

Thanks

JK

afartherroom

afartherroom on November 27, 2010, 12:15 a.m. Reply

Is there no way to specify type=”all?” It would be nice if there were.

Leave a Comment