Movable Type Documentation > Appendices > Appendix: Template Tags

Categories

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

This page was last updated on 2008-03-29, 00:45.  

1 User Contributed Notes

Jay Allen Author Profile Page said:

This tag supports the MultiBlog template tag attributes blog_ids/include_blogs and exclude_blogs for aggregating across different blogs.

Submit a User Contributed Note

User contributed notes are a great way to share the knowledge you have gained in using Movable Type.

If you have a technical question or problem, please visit Movable Type Support.

(If you haven't left a note here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)