Hi everyone ,
Is there a quick way to fetch all articles from a blog part in kirby MINUS the ones with a specific tag ?
Thanks in advance
Hi everyone ,
Is there a quick way to fetch all articles from a blog part in kirby MINUS the ones with a specific tag ?
Thanks in advance
You can use filterBy()
with an operator:
$filtered = page('blog')->children()->visible()->filterBy('tags', '!=', 'some_tag');
thanks a lot !
It worked great, just adding the separator for tags at the end, in case anyone is looking for thisβ¦
$filtered = page('blog')->children()->visible()->filterBy('tags', '!=', 'some_tag', ',');