We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Is it possible to display the number of items in a category?

Hi

Is there a similar feature (or way) to achieve this perch:blog id="qty" with perch:category?

I'd like to display the number of items in a category, like this:

  • Transport (4)
  • Business (3)
  • Community and Infrastructure (8)
  • Housing (2)

I've used <perch:showall /> on perch:category and there doesn't appear to be a qty ID

Is it possible to do this?

Health Check

  • Perch Runway is up to date
  • PHP 7.0.22 is up to date
  • MySQL 5.6.35 is up to date
  • Image processing available
Stephen Meehan

Stephen Meehan 4 points

  • 1 year ago
Drew McLellan

Drew McLellan 2637 points
Perch Support

In Blog or elsewhere?

Hi Drew,

Elsewhere. I'm using categories with a collection, it'd be useful to list how many items are in each category.

Drew McLellan

Drew McLellan 2637 points
Perch Support

No, because the categories can be used for anything across the system. The count wouldn't be meaningful without the ability to restrict it to one type of content.

Ok, thanks for letting me know.