I'm trying to get all of an entry's categories to display with the hierarchy intact... basically, a combination of mt:Subcategories and mt:EntryCategories. (why there is no mt:EntrySubcategories is still beyond me.) In order to simulate this behavior, I have to go to great lengths apparently. Here's what I've got.
CODE
<mt:EntryCategories>
<mt:if tag="CategoryLabel" like="(items|colors|materials|themes)">
<mt:SetVarBlock name="current"><mt:CategoryLabel></mt:SetVarBlock>
<dt><mt:CategoryLabel></dt>
<dd>
<mt:EntryCategories><mt:if tag="ParentCategory" eq="$current"><mt:CategoryLabel></mt:if></mt:EntryCategories>
</dd>
</mt:if>
</mt:EntryCategories>
Basically... go through the EntryCategories list and if it's a parent category, set it to $current and print it ... followed up by going through the EntryCategories list again and only printing the labels of categories that have $current as their parent.
This code actually works like it should. But when I tried to follow up the <mt:CategoryLabel /> with a comma (since it's a list of subcategories), everything stops working and I just get empty <dd>s, which really is making no sense to me. This made me try completely static content inside the <mt:if>s, but that also returned empty <dd>s.
For some reason, it only works correctly if I print CategoryLabel and nothing else... not even a space. I tried a couple other category related tags and "CategoryBasename" also works... but not CategoryArchiveLink, CategoryCount, etc.
What's going on here? More importantly, how do I get what I want, even if it means abandoning this particularly bizarre track?
Any help appreciated.