I want to query posts for a multiselect value and can’t get it to work. Here is my initial situation, which works in one place.
artists: label: Betrifft folgende Artists type: multiselect options: query query: site.page("artists").children
<?php foreach ($page->children() as $item): ?> <?php $artist = $item->artists()->toPages(','); ?> <ul> <?php foreach($artist as $bla): ?> <li> <a href="<?= $bla->url() ?>"><?= $bla->title() ?></a> </li> <?php endforeach ?> </ul> <?php endforeach ?>
I like to filter those news by a custom “artist” in the “artists” multiselect.
Intuitivley I tried this, suspecting that it would not work.
<?php $bla = $pages->find('news')->children()->filterBy('artists', 'in', 'Carl Andre') ?>
To check if it’s really just this secific filtering I tried it by title and it worked.
<?php $bla = $pages->find('news')->children()->filterBy('title', 'Rhabarber') ?>
I think I somehow need to split «artists» up but I have no idea how.