Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Is it possible to count the number of times a field value appears across pages?
For example, if I have a clonable template called Employees, and I have the fields: location, salary, age, designation, and I want to know the number of times designation CEO appears across all the pages, how would I do that?

Thank you
Well, if you can filter such pages (following docs of pages tag) then you should be able to count them.
Thanks trendoman for the response, however I still do not know how to do it.
Could you please give me an example so I can have an idea where to start?
Like in the example i had given earlier, if I have several pages where the designation is CEO, I need to count the number of times CEO appears in all the pages.

Many thanks
No problem,
I found the way to do it.
Code: Select all
   <cms:pages masterpage='employees.php' custom_field='designation=CEO' limit='1' order='asc'>
      <li><cms:show program/> <cms:show k_total_records/></li>
   <cms:pages masterpage='employees.php' custom_field='designation=Secretary' limit='1' order='asc'>
      <li><cms:show program/> <cms:show k_total_records/></li>

Thank you for pointing me in the right direction!
4 posts Page 1 of 1

Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 20 guests