List all blog tags (links) on any given blog page

Just can’t quite figure this out. I would like to list to all blog tags/collections on any blog page.

I have followed the cookbook and so for my blogs page I have the controller:

return function ($page) {

    $tag = urldecode(param('tag') ?? '');

    $blogs = collection('blogs');

    if (empty($tag) === false) {
        $blogs = $blogs->filterBy('tags', $tag, ',');
    }

    return [
        'tag' => $tag,
        'blogs' => $blogs->paginate(6)
    ];

};

and render that on the blogs page:

// fetch all tags
$tags = $page->children()->listed()->pluck('tags', ',', true);

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

That works great.

I lack the knowledge to get that same list to render on my individual blog pages. The goal is to have an

You can use the same code as here, with the only difference that you don’t use $page->children(), but the sibling pages

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

Aha! I was straining to make it work with parent(). That was the wrong point of view.

One of my favorite phrases…“It’s easy when you know how.”

You’re terrific.