<mt:ParentCategories>
A block tag that lists all the ancestors of the current category.
Output all parent categories and glue using a forward slash:
<mt:ParentCategories glue ="/">
<$mt:CategoryLabel$>
</mt:ParentCategories>
Attributes ¶
exclude_current ¶
This optional boolean attribute controls the exclusion of the current category in the list.
glue ¶
This optional attribute is a shortcut for connecting each category label with its value.
Examples ¶
Breadcrumbs ¶
Use the following code on Category archive template. If the current category has a parent category, loop through the parent categories starting at the top level (excluding the current category), then output the title of the current archive.
<mt:HasParentCategory>
<mt:ParentCategories exclude_current="1">
<a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a> /
</mt:ParentCategories>
</mt:HasParentCategory>
<$mt:ArchiveTitle$>
On an Entry archive template:
<mt:HasParentCategory>
<mt:ParentCategories>
<a href="<$mt:CategoryArchiveLink$>"><$mt:CategoryLabel$></a> /
</mt:ParentCategories>
</mt:HasParentCategory>
<$mt:EntryTitle$>
Gautam Patel
April 1, 2010 3:38 AM | Reply
This returns a pretty neat output with nice chevrons instead of the slash as in the first example:
Yields this:
Each one linked to its archive page.