i’ll let you know what i’m trying to achieve:
i want to have an involvement-bar that shows parts in projects that the user has taken place in. Therefore i created a page with »involvement«-subpages. Those are able to get selected through a query inside the section(project)-blueprint. At this moment everything works fine.
In the frontend i create the bar with the different steps like this:
<div class="involvement--holder"> <ul> <?php $parentSlug = $page->parent()->involvement()->split() ?> <?php $involvements = $site->index()->filterBy('template', 'involvement_web'); ?> <?php foreach($involvements as $involvement): ?> <li class="involvement--list-item <?php e((array_key_exists($involvement->slug(), $parentSlug)), 'active') ?>"> <div class="involvement--progress-bar" style=""> </div> <?php echo $involvement->slug() ?> </li> <?php endforeach ?> </ul> </div>
What i want now is to look if the slug of the step matches the value inside the comma separated output i get from the multiselect-field to set an active-class. I tried the ecco und the array_key_exists method, but none of them seem to work properly. Can anyone help with this? I guess there is a dead-simple solution for this…
Thanks so far