Happy holidays to everyone… just a quick question for anybody once you’re back at work
I am trying to
count() the amount of pages with a multiselect field.
In this case, the multiselct field is artworkType.
<?php if($page->artworkType()->isNotEmpty()): $siblings = $page->siblings()->listed(); $types = $siblings->pluck('artworkType', ',', true); foreach($page->artworkType()->split() as $artworkType): ?> <div> There are <?= $siblings->filterBy('types', $artworkType, ',')->count() ?> <?= $artworkType ?> in the database. </div> <?php endforeach ?> <?php endif ?>
I am only getting 0 as the count number.