Tags composed of two words

Hello, I have a Problem with tags composed of two words not just one.

My tags with two words produce a url with a space in between, which logically does not work well.
The effect is, that the tags with two words will appear in the tag cloud, but when i click them, they will show any projects with these tags.
I tried to implement your solution, everywhere i could think of, but it always trows an error.

Here is every peace of code that is doing something with the my tags:

<?php foreach($tags as $tag): ?>
    <li>
      <a <?php e($tag == $p, ' class="buttonActive tag"') ?> class="tag" href="<?= url('Arbeiten', ['params' => ['tag' => $tag]]) ?>">
        <?= html($tag)?>
      </a>
    </li>
<?php endforeach ?>

the controller:

 if($tag = param('tag')) {
 $Arbeiten = $Arbeiten->filterBy('tags', $tag, ',');}

$tags = $page->children()->listed()->pluck('tags', ',', true);
sort($tags);

$p = kirby()->request()->params()->tag();

Would be so glade, if someone could help me with this problem.


Accidentally i posted the question under this post from Kirby 2:

Here the answer:

And it worked. Thanks!

1 Like