Filter with multiple tags

Hi, is it possible to display in a template, tags as checkboxes, with multiple choice options? Like in this example: Projects - Wanzenried & Partner

I can manage it with 1 tag with filterby but not with multiple tags selection.

Thank you very much for your help.
Best

Could you please post the code you tried, both form part with the checkboxes and the filter logic in your controller/template?

Right now, I have this option who manage one tag at the time:
I would like to do the same thing with “checkboxes” and multiple selection possible, also with projects that have multiple tags. Is it possible with this method “Filterby”?

Filter:

<?php $filterBy = get('filter'); $unfiltered = $page->children()->listed(); $projects = $unfiltered ->when($filterBy, function($filterBy) { return $this->filterBy('tags', ' ', $filterBy); }); $filters = $unfiltered->pluck('tags', ' ', true); ?>

Menu:

Items:

<?php foreach ($projects as $project): ?>
                    <div class="cell large-4">
                        <div  class="<?= $project->tags() ?>">
                        <a href="<?= $project->url() ?>">
                            <h3><?= $project->title() ?></h3>
                        </a>
                        </div>
                    </div>
            <?php endforeach ?>

Ouh sorry the code went weird

<?php 

    $filterBy = get('filter');
    $unfiltered = $page->children()->listed();
    $projects = $unfiltered
        ->when($filterBy, function($filterBy) {
            return $this->filterBy('tags', ' ', $filterBy);
        });

    $filters = $unfiltered->pluck('tags', ' ', true);

    ?>
<ul>
                        <li><a href="<?= $page->url() ?>">Alle</a><span></span></li>
                        <?php foreach ($filters as $filter): ?>
                        <li> 
                          <a href="<?= $page->url() ?>?filter=<?= $filter ?>"><?= $filter ?>
                          </a><span></span></li>
                        <?php endforeach ?>
                    </ul>
<?php foreach ($projects as $project): ?>
                        <div class="cell large-4">
                            <div  class="<?= $project->tags() ?>">
                            <a href="<?= $project->url() ?>">
                                <h3><?= $project->title() ?></h3>
                            </a>
                            </div>
                        </div>
                <?php endforeach ?>

The first step would be to convert your list of links to checkboxes, because multiple tags cannot be selected via links.

The second step is then to change the filter by using

  1. The result don’t have to match all tags (or)
 return $this->filterBy('tags', 'in', $filterBy);
  1. The result should match all selected tags (and)
 return $this->filter(fn($item) => sort($item->tags()->split()) === sort($filterBy));