<mt:HasParentCategory>
Returns true if the current category has a parent category.
<mt:Categories>
<mt:HasParentCategory>
<$mt:CategoryLabel$> has a parent category.
</mt:HasParentCategory>
</mt:Categories>
This type of conditioning can be done with the mt:IfCategory tag as well.
Example ¶
List categories noting if each has a parent or not. If has a parent, list the parent category:
<ul>
<mt:Categories>
<li>
<mt:HasParentCategory>
<$mt:CategoryLabel$> has a parent category.
<mt:ParentCategory>
(Parent Category: <a href="<mt:ArchiveLink>"><mt:CategoryLabel></a>)
</mt:ParentCategory>
<mt:Else>
<$mt:CategoryLabel$> has no parent category.
</mt:HasParentCategory>
</li>
</mt:Categories>
</ul>
Related ¶
This page was last updated on 2009-06-23, 19:32. [Edit]

Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.