Category Items Count

Julian C. asked on March 18, 2019 22:56

What would be the easiest way to display the number of items under each Category like this: Podcasts (45) Articles (33) Video (24) and so on. Now, I'm using Category List web part which displays all the Categories just fine but without item count.

Recent Answers


Brenden Kehren answered on March 19, 2019 00:32

Use a repeater and get the categories with a custom query. Then you can use the CategoryCount field. The downside is it counts all pages assigned to that category and doesn't take anything else into consideration like the path you're on and only counting those pages.

0 votesVote for this answer Mark as a Correct answer

Julian C. answered on March 20, 2019 20:28 (last edited on March 20, 2019 20:28)

Thanks Brenden, I ended up using this a Repeater with Custom Query as instructed on this article.

You were right, it does count all the pages in the categories.

Now, I just need to figure out how to filter the results based on certain path. For example, I only want to display category items count for all the pages under Podcasts which has tons of pages under it. Any ideas? Filter the custom query by NodeAliasPath?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.