Hi - I’m pretty new to Kirby. Coming from CouchCMS was really easy.
I need some help with a small bit of the Tag code. I am trying to have a tag list in the footer of my site that allows someone to go to topics in my journal. I’ve been using this:
I suggest you put the tags loop into a snippet (e.g. /site/snippets/tags.php) and inside that snippet define your $tags variable. Then include that snippet in every template where you need it.
Otherwise, your $tags variable is only known in the journal.php template.
Snippet tags.php
<?php
$tags = page('journal')->children()->listed()->pluck('tags', ',', true);
foreach ($tags as $tag): ?>
<!-- Rest of code -->
<?php endforeach ?>
In templates replace the loop with
snippet('tags');
Another option would be to define the tags as a custom collection and then call that collection in the snippet