count number of field page type

web dev asked on January 28, 2019 21:16

hello kentico is there any macro in transformation can count number of field page type structure :

NewsName :3

CategoryName: 5

Sport:10

Recent Answers


Peter Mogilnitski answered on January 28, 2019 22:48 (last edited on December 10, 2019 02:31)

if i understand correctly ... you can use count property: {% Documents[path].Children.Where("ClassName = 'cms.menuitem'").Count |(identity)GlobalAdministrator%}, but if really want do do some sort of group by you will be better off with a custom macro or you want to get # of fields in 'cms.menuitem' page type?

0 votesVote for this answer Mark as a Correct answer

web dev answered on January 29, 2019 10:34 (last edited on January 29, 2019 10:35)

hello Peter Mogilnitski for exmple i have newsName(sport,Advice) i want macro that count how many sport exist :

Sport:3 Advice:12

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on January 29, 2019 14:59

You want to count how may occurrences of a certain word you have in some document field?

0 votesVote for this answer Mark as a Correct answer

web dev answered on January 29, 2019 15:26 (last edited on January 29, 2019 15:41)

yes Peter Mogilnitski see this Image

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on January 29, 2019 16:10

Ok. Instead of having custom field you probably should look into document tags. Then you can use macro and web parts to do what you want.

0 votesVote for this answer Mark as a Correct answer

web dev answered on January 29, 2019 17:36

its just page type fields

0 votesVote for this answer Mark as a Correct answer

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