Help - Search - Members - Calendar
Full Version: display entry count for category?
Movable Type Community Forum > Additional Resources > Tips and Tricks
-lc-
I've figured out how to display the category that an entry belongs to, but I would like to add a count next to the category display (like the comment count for the entry) example:
CODE
weblog entry
blah blah blah
category: tv/film (22)  <<--- how to do this?

Of course this can be done quite easily from a complete category listing with $MTCategoryCount$ but I am trying to show it for just one category that the entry is related to? I don't quite understand if MT can be told to only loop for one specific category by using something like this?
CODE
<$MTEntryCategory$>
<MTCategories category="<$MTEntryCategory$>">
(<$MTCategoryCount$>)
</MTCategories>


can this filter categories plugin help me?

(on a side question, is it possible to maybe show up to two categories than an entry belongs to?)
maddy
Check out the MTEntryCategories tag from the manual - it should answer both of your questions, but definitely your side question (and you could also use FilterCategories in there as well, as an alternative). smile.gif
-lc-
Thank you for such a gentle (and FAST!) reply...

I feel so silly as I figured out the answer about 5 minutes after I posted it. First modification attempt for my template, so that wasn't too bad wink.gif

Here's what I used for the next person that stumbles across this:
CODE
<MTEntryCategories glue=" - ">
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$>(<$MTCategoryCount$>)
</a>
</MTEntryCategories>


What a wonderful program and community, thank you!
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.