Tagcloud not working

I try to use tagcloud logic from Cookbook: https://getkirby.com/docs/cookbook/content-structure/filtering-with-tags

kirby\http\params::separator(['tag' => $tag]) return empty strings so generated url is http://example.com/blog/:

Any suggestions?

Thanks

Hm, the separator() function doesn’t accept a parameter. This should work, but maybe there is a better way:

<a href="<?= url($page->url() . '/tag' . Kirby\Http\Params::separator() . $tag) ?>">

You can also use this:

<a href="<?= url($page->url(), ['params' => ['tag' => $tag]]) ?>">

I assume this uses the correct separator internally.

Thanks, second example working. Can you also fix it in cookbook for others please :slight_smile:
And I have one question which is related to tags, pagination and link back from article detail.

Should I create new topic?

  1. Yes, I was going to. :white_check_mark:
  2. Yes, please.
1 Like

I have used the updated recipe from the cookbook and I am able to create a tagcloud with it but whenever I click on one of the displayed tags the updated page shows the same amount of articles as before, so the filtering doesn’t appear to be working.
Two things I have added to my Kirby test environment are the following:

  1. ‘home’ => ‘blog’ in config.php
  2. multi-language activated with EN & DE (all URLs contain a /en/ or /de/
    Could this be the reason and if yes how to fix it?