Forum

Thread tagged as: Question

Display number of items in a category?

Hi,

Is there a way to output the number of items in a particular category.

Here's my use case: I'm building a book site in regular Perch where each book entry has a category set called gender with two categories: men and women. I'd like to be able to have a stats page that simply lists how many of the books on the site were written by men and how many were written by women, in effect just outputting the number of items that have been categorized either with "men" or "women." Is that possible with Perch? Thanks!

Franz Neumann

Franz Neumann 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

For a region, or a collection, or across all entries on the system? Or something else?

It's for a region called "Books" that has fields for title, author, cover image and then lots of categories, one among them being for the author's gender. Thanks.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think we can do that for a region currently.

The site only has the one region, Books, and that's the only one that uses categories. Is there a way to do it for all entries on the system?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't believe so currently.

Thanks Drew. Would love to see that functionality in the future.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Me too!