Search
Other Articles Anywhere questions
Forum

count the articles of a category

Seppi's Avatar Seppi
Hey Peter

I fear I'm thinking / searching too hard for something quite simple:

Can we display the total of articles published in an specific cagetory?

It's about a 3 types of offer categories and I want to show, how much offers are available in each.

thank you

P.
Peter van Westen's Avatar Peter van Westen ADMIN
You could do this by doing something like this:
{articles category="My Category" limit="1"}[total_no_limit]{/articles}

See: docs3.regularlabs.com/articlesanywhere/data-tags/numbers
Please post a rating at the Joomla! Extensions Directory
Seppi's Avatar Seppi
... thanks a lot, Peter. This is exactly the hint I needed. I obviously didnt' get, what [total_no_limit] can do.

And of course it works like a charme, now.

As I always say: Regular Labs rulez!
Peter van Westen's Avatar Peter van Westen ADMIN
Happy that works for you.
Thnx! 🙂
Please post a rating at the Joomla! Extensions Directory
Seppi's Avatar Seppi
Hello

I couldn't find the answer to this in the manual. We're trying to use something like this:
{articles tag="18" limit="1"}{if title > 0}[total_no_limit]{else}0{/if}{/articles}

This results in an empty output (instead of showing "0"). How can we say "if there are zero articles with this tag to show, then show the number 0 instead"?

Thanks in advance

S.
Peter van Westen's Avatar Peter van Westen ADMIN
What is inside the {articles} tags is repeated for every article it finds. If there are no articles, then it won't output anything.

Also checking a text string (title) to see if it is greater than 0 makes no sense.

Try using the empty="..." attribute:
docs3.regularlabs.com/articlesanywhere/p...gs#output-when-empty
Please post a rating at the Joomla! Extensions Directory
Seppi's Avatar Seppi
Oh, I was looking in the completely wrong section then. With empty="0" it works, of course 😉. Thanks a lot - and again: Regular Labs friggin' rulez!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription