Use multiselect as a menu

I’m new in kirby, I’m making a website with article, in the panel I have created a multiselect checkbox, to link the article to an option of my multi select. But I would to fetch all the option of my multi select field as a menu where when you click on an option, this action display only the related articles

there is my multi select field :

    label: Theme
    type: multiselect
    required: true
      Brevets: Brevets
      Technologies: Technologies
      Comportements: Comportements
      Besoins: Besoins
      Gestes: Gestes  
      Œuvres: Œuvres

there how my menu is for the moment:

    	<div id="info">
			<h1><a href= "home" ><?php echo $site->title()?></a></h1>

<ul id="menu">

			<?php foreach($pages->visible() as $menu): ?>
							<a <?php e($menu->isOpen(), ' class="active"') ?> href="<?php echo $menu->url() ?>" title="<?php echo $menu->title() ?>">
								<?php echo $menu->title() ?>

<!-- 						<li>
			      	<a href="<?php echo url('theme') ?>">
			          <?php echo $page->theme()->html() ?>   
			      </li> -->

			<?php endforeach ?>


thank for you help!

This would be similar to using tags.

You can use the pluck() method to get all used “themes”:

$themes = page('articles')->children()->pluck('theme', ',', true); 

Then you can loop through these to build your menu.

As for filtering by these “themes”, check out this recipe:

I try this, the used theme are display on my website :

			<?php foreach ($page->children('article')->pluck('theme', ',', true) as $themes): ?>

		      	<a href="<?php echo url($page->url() . '/'. url::paramsToString(['theme' => $themes]))?>"> <?php echo html($themes)	?></a>
		<?php endforeach ?>

but I don’t really get how to filter only the articles link to a theme and display only these articles.

In your controller (or template, if you are not using a controller):

$articles = $page->children()->visible();
if($theme = param('theme')) {
  $articles = $articles->filterBy('theme', $theme);

Note that children() does not take a parameter. So this:

$page->children('article')->pluck('theme', ',', true)

should be

$page->children()->pluck('theme', ',', true)