Hello, I am trying to put multiple tags on the page, filtering items by each other or sometimes together…
the url like → home/category:works + timeline:2022
But using these codes(below an image), I keep getting this error message…
on controller.php
$workcategory = param('category');
$worktimeline = param('timeline');
$artworks = page('home/works')->children()->listed()
->when($workcategory, function ($workcategory) {
return $this->filterBy('category', $workcategory);
})
->when($worktimeline, function ($worktimeline) {
return $this->filterBy('timeline', $worktimeline);
});
$categories = $artworks->pluck('category', ',', true);
$timelines = $artworks->pluck('timeline', ',', true);
<?php foreach($categories as $c): ?>
<li>
<a href="<?= url('home', ['params' => array_merge(params(),['category' => $categories])]) ?>">
<?= html($c) ?>
</a>
</li>
<?php endforeach ?>
Could you let me know how to filter by multiple tags in Kirby 3.7.5?
Thank you:)