Display value in a filter using filtering with tags instead of the name of the option

Hi,

For a portfolio, I use the cookbook “Filtering with tags”, it works well, but it displays the name of the option (e.g.: wellness).

I want to display the value (e.g.: bien-être), so I tried this, but it says that the value field() is null.

// controller: projects.php

<?php
return function ($page) {
  // fetch the basic set of projects
  $projects = $page->children()->listed();

  // fetch all categories
  $categories = $projects->pluck('category', ',', true);

  $catlist = $projects->blueprint()->field('category');
  $catvalues = $projects->category()->split(',');

  // add the category filter
  if ($category = param('category')) {
    $projects = $projects->filterBy('category', $category, ',');
  }

  // pass variables to the template
  return compact('projects', 'categories', 'catlist', 'catvalues', 'category');
};
<!-- template: projects.php -->

<?php foreach ($categories as $category): ?>
      <?php foreach ($catvalues as $catvalue): ?>
        <li>
          <a
            href="<?= url($page->url(), ['params' => ['category' => $category]]) ?>"
            class="cursor-pointer tag tag-selectable tag-outline tag-forestgreen">
            <?= $catlist['options'][$catvalue] ?? $catvalue ?>
          </a>
        </li>
      <?php endforeach ?>
    <?php endforeach ?>

Ca you help me?