Help - Search - Members - Calendar
Full Version: Showing The Number Of Entries In Each Category
Movable Type Community Forum > Additional Resources > Tips and Tricks
siliconarrow
Hello,

is there any way to show the number of entries in each category?
If implemented, it might look like this:

category1 (34)
category2 (12)
.............
categoryN(3)


Thanks!

Silicon arrow
lisa
<MTCategories>
<$MTCategoryLabel$> (<$MTCategoryCount$>)
</MTCategories>

should do the trick.
siliconarrow
Lisa,

thank you but I do not understand how to use this exactly...
This is the code for my Categories:

-->

<MTIfArchiveTypeEnabled archive_type="Category"><div class="module-categories module">
<h2 class="module-header">Categories</h2>
<div class="module-content">
<MTTopLevelCategories>
<MTSubCatIsFirst><ul class="module-list"></MTSubCatIsFirst>
<MTIfNonZero tag="MTCategoryCount">
<li class="module-list-item"><a href="<$MTCategoryArchiveLink$>" title="<$MTCategoryDescription$>"><MTCategoryLabel></a>
<MTElse>
<li class="module-list-item"><MTCategoryLabel>
</MTElse>
</MTIfNonZero>
<MTSubCatsRecurse>
</li>
<MTSubCatIsLast></ul></MTSubCatIsLast>
</MTTopLevelCategories>
</div>
</div>
</MTIfArchiveTypeEnabled>

<--

Where exactly should I modify it?

Thanks in advance! mellow.gif
imabug
QUOTE (siliconarrow @ Feb 9 2006, 04:03 PM)
Where exactly should I modify it? 

Thanks in advance!  mellow.gif
*

The relevant item that Lisa mentioned is <$MTCategoryCount$> which will display the number of entries in that category. Put it wherever you want it to show up in your code snippet. In your case,
CODE
<li class="module-list-item"><a href="<$MTCategoryArchiveLink$>" title="<$MTCategoryDescription$>"><MTCategoryLabel> (<$MTCategoryCount$>)</a>
siliconarrow
Thanks to both of you! It worked... biggrin.gif
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.