I want to create 3 snippets now, that display the menus at the respective position in the theme. I try to filter them by the field “Menu Control” but it doesn’t work. Can you tell me, where my mistake is?
$menu in your example is a structure, i.e. a collection, not a single item, so $menuControl won’t give you anything.
Let’s say you want to get the main menu:
<?php
// all menus defined in the structure
$menus = $site->menus()->toStructure();
// find the one where menu_control is `mainmenu`
$mainMenu = $menus->findBy('menu_control', 'main_menu');
if ($mainMenu) {
// do stuff
}
Note that you have to adapt the field names/values to the ones used in your blueprint (since you haven’t posted them).