Counting quantity of active fields


Hey there,

I’m having a list and also using this custom country select field:
At some point I want to show the following message:

You can actually find ___ publishers from _____ different countries.

I did to count the total of projects on the folder but I want to show the countries used at the moment (ex. 20) somehow.
There’s any way to do that with the $count parameter as well?

I hope I’ve clarified this.
Thanks in advance!


You can do it like this:

$noOfCountries = count(page('projects')->children()->pluck('fieldname-of-select-field', ',', true));


Thanks a lot. It worked!


11 posts were split to a new topic: Sorting projects by different categories on button click