Help - Search - Members - Calendar
Full Version: Creating Category Archive List While Exluding
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
joe schmidt
Hello,

Trying to create a category archive list, something that will show the category and list underneath it all posts filed under that category. I also want to exclude certain categories. Trying to use mt:if but to no avail, here is what I have:

CODE
<mt:Categories>
<mt:If tag="CategoryLabel" ne="Fruits|Vegetables|Dairy">
<h3><$MTCategoryLabel$></h3>
<ul><mt:Entries>
<li><a href="<$MTEntryLink$>"><$MTEntryTitle$></a></li>
</mt:Entries>
</ul>
<br />
</mt:if>
</mt:Categories>


In the example above, I want to list all the categories (and their associated posts) except for the categories Fruits, Vegetables, and Dairy. The code I listed just isn't working. I am on MT 4.0.

Thanks.
OtherNiceMan
Does it work with a single category?

Try

CODE
<mt:Categories>
<mt:If tag="CategoryLabel" like="(Fruits|Vegetables|Dairy)">
<mt:else>
<h3><$MTCategoryLabel$></h3>
<ul><mt:Entries>
<li><a href="<$MTEntryLink$>"><$MTEntryTitle$></a></li>
</mt:Entries>
</ul>
<br />
</mt:if>
</mt:Categories>


This should not output anything if the category matches.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.