mdn_count
You heard it here first! The mdn_count plugin is used on this site and does a couple of minor things. This plugin will count the number of articles in a particular section. It will also count the number of articles with a given category (in either field 1 or 2). It returns the number. That’s it!
Currently at version 1.3. It will also count the number of articles in the intersection of section and category, and will take # as a reference to use the currently selected section or category for counting.
Usage:
<txp:mdn_count [section="sectionname"] [category="text"] />
NOTE: The items in square brackets are optional and the brackets should not be used in the construction of the tag.
- Parameters
- section – This item is OPTIONAL. The plugin will return the number of articles in the given section name.
- category – This item is OPTIONAL. The plugin will return the number of articles with the given category name, in either category1 OR category2.
- Notes:
- There is some basic checking. The two parameters are optional, but it doesn’t make sense if BOTH are gone. I think that’s the only one it catches.
- Section takes precedence over category if both are specified.
Examples:
<txp:mdn_count section="plugins" category="comments" />
will return the number of articles in the section ‘plugins’, categorized as ‘comments’
e.g. there are 55 articles categorized in ‘comments’ in the ‘plugins’ section.
<txp:mdn_count category="conditional" />
will return the number of all articles categorized as ‘conditional’
e.g. there are 0 articles categorized as ‘conditional’









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (4)
the download link is dead. the one from the forum thread works: http://mnorton.chaosnet.org/files/mdn_count.txt
UPDATED: v2.0
Completely rewritten for TXP 4.2.0/4.3.0.
^^^ Correction (post was moved: v2.0 is here.
Hi, I’m looking for a way to have ‘x of y articles’.
mdn_count gives me the y, but I can’t figure out how to get the x.
This is for individual article pages, between link_to_prev and link_to_next tags
Any idea how I can make this work?
I’m very new to txp; Expression Engine has {count} and {absolute_count} tags, but unless I’m in list view, I don’t think I can easily achieve the same effect with txp (but hopefully I’m wrong).
Thanks in advance
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site.