Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi,
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.
unlimited time premium coding support per project - PM or email me or discuss in topic
active topics
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
<ul>
   <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>
   <cms:pages masterpage='employees.php' custom_field='designation=Secretary' limit='1' order='asc'>
      
      <li><cms:show program/> <cms:show k_total_records/></li>
   
   </cms:pages>
</ul>

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

Who is online

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

Users browsing this forum: No registered users and 3 guests