Re: mdn_count

That works great! Thank you very much! Though you may want to add the option ‘all’ to the time attribute in case people want a total count of all articles (like it used to supply)? I don’t have a use for that myself, though.

I was actually needing it to tell me if I have more than a certain number of articles in a section so I could then provide a link to the rest of them (with excerpts on the opening list). I could not find a way to use txp:variable to do this comparison, so I modified the return value from mdn_count to basically give me a yes or no type of value instead of the actual count (send back a 5 if there are more than 5 articles — the number of articles I give a preview for — or a 0 if there are 5 or fewer). I could then use txp:variable to determine the answer to the yes/no question of whether I needed a link or not.

Re: mdn_count

Well it depends if you are going to use mdn_count in any other part of your templates/forms. If this is your only use of this plugin, then modifying it as you have it probably the best method. If you want to use this plugin again (using the way it was originally coded – to return a number), then you’re better off wrapping it in smd_if – use something like this:

<txp:smd_if field='<txp:mdn_count section="foobar" />' operator="gt" value="5">
do stuff here for more than five articles<txp:else />
do stuff here for 5 or less articles</txp:smd_if>

In regard to adding all as a value for the time attribute, this isn’t necessary because it accepts multiple values – you can use now,past,future and every single article will be counted.

Re: mdn_count

Okay I see what you mean, similar to customfieldname. This is a pretty specific scenario, but I think it could be done with a couple of generic attributes, filterfield and filtervalue. That way you could use if for custom fields, and other users could use if for any other column in the table.