Macro in transformation can count number of field page type

web dev asked on January 30, 2019 11:11

hello kentico is there any macro in transformation can count number of field page type for me i have categoryNews structure iMAGE HERE:

Saving :3

money: 5

Sport:10

Recent Answers


Brenden Kehren answered on January 30, 2019 16:09

You can use the field CategoryCount to get the number of documents assigned to that category. This is just a counter and does not take into consideration where you are in the content tree. Meaning, you have 10 pages assigned to category "Money". 6 of those pages are under /Loans and 4 of the pages are under /Open-An-Account, it will display all 10 of them. If you want to filter the CategoryCount based on where you are in the content tree, you'll have to do a custom query for that.

Simply using/displaying the CategoryCount field should work in most cases though.

1 votesVote for this answer Mark as a Correct answer

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