Type: block
A container tag representing a list of categories in a blog. This tag produces output for every category with no regard to their hierarchical structure.
Attributes
show_empty- Setting this optional attribute to true (1) will include categories with no entries assigned. The default is false (0), where only categories with entries assigned.glue- A string used to join the output of the separate iterations of MTCategories. This can be as simple as a comma and space (", ") to list out category labels or complex HTML markup to be inserted between the markup generated by MTCategories.
Example
List out the categories used on at least one blog entry, separated by commas:
Categories: <mt:Categories glue=", "><mt:categorylabel /></mt:Categories>
List all categories and link to categories it the category has one or more entries:
<MTCategories show_empty="1">
<mt:if name="__first__">
<ul>
</mt:if>
<mt:if tag="CategoryCount" gte="1">
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
<mt:else>
<li><$MTCategoryLabel$></li>
</mt:if>
<mt:if name="__last__">
</ul>
</mt:if>
</MTCategories>
Related
- Template Loop Meta Variables offer conditionals for odd, even, first, last, and counter.
1 User Contributed Notes
This tag supports the MultiBlog template tag attributes blog_ids/include_blogs and exclude_blogs for aggregating across different blogs.