I’d like to realize an tag overview page, where I want to put an intro text according to the current tag.
If I open: …/overview/tag:something
I’d like kirby to show an intro text für the tag “something”.
I understand that I can read the current tag with
But what is the best way to store the descriptions for the tags?
I try something like this, but it doesn’t show anything:
<div class="intro text">
$name = param('tag');
<p><?php echo $site->find('stichworte/'.$name)->text(); ?></p>
<?php endif; ?>
Is the path to the page correct? Is the name of field correct?
From your code you should have a page
/content/stichworte with subpages for each tag?
It works, when I hard set the variable $name;
What could be the problem with
$name = param('tag'); ?
Are you using multi-word tags?
no, it’s one word like “Abfindung”
But I guess your page UID is “abfindung” not “Abfindung”?
$name = str::lower(param('tag'));
aaah. That fixed it. Thank you very much!
Note that if you also use multiword tags or Umlaute, you might want to use