Tags
A container tag used for listing all previously assigned entry tags for the blog in context.
Attributes
glueA 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.
typeThe 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, andasset.sort_byThe tag object column on which to order the tags. Common values are
nameandrank. By default tags are sorted byname.sort_orderThe direction in which to sort tags by the
sort_byfield. Possible values areascendanddescend. By default, tags are shown in ascending order when sorted by name and descending order when sorted by other columns.limitA number of tags to show. If given, only the first tags as ordered by
sort_byandsort_orderare shown.topA 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
topis used, the tags are shown in the order specified withsort_byandsort_order.include_private="0"Use a value of
1to include private tags (tags starting with@). This modifier was added to Movable Type 6.0.4.exclude_blogsinclude_websitesexclude_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>
Joshua Konkle on March 21, 2008, 4:41 p.m. 返信
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 on November 27, 2010, 12:15 a.m. 返信
Is there no way to specify type=”all?” It would be nice if there were.