Menu builder question

Hi!
My site is getting real complicated with all possible sliders, details, snippets, albums etc,
so i need more control over what is being shown in the menu.

i have found this LINK, so i added it to site.yml file.
Nothing happens - can you please explain in a bit more detail how to control menu per panel, or shall i hardcode it?
Thanks!

What do you mean with

In the Panel? On the frontend?

in the panel. where am i supposed to be looking for it?

If you have modified your site.yml, the new fields should appear right on the first view you see after accessing the Panel.

If not, please post your blueprint, maybe there is something wrong with it.

title: Site
preset: pages
unlisted: true

  menu:
type: structure
  fields:
    mainMenu:
      type: pages
      label: Mainmenu item
    max: 1
      hasSubmenu:
        type: toggle
        text: Include a submenu?
    subMenu:
      type: pages
      label: Submenu items
      when:
        hasSubmenu: true

Would this be a correct definition? (i’ve just wanted to test this so took the one from the link and copypasted^^ ) Sry this markdown is hard on me - never worked with it before, perhaps some structural issue? Could you please post a model site yml file of how it would look like if correctly implemented? thanks a lot, Texnixe :smiley:

Oh, there is something missing and your indentation is not correct either. You need at least the fields key and cannot use the pages preset:

title: Site

fields
  menu:
    type: structure
    fields:
      mainMenu:
        type: pages
        label: Mainmenu item
        max: 1
      hasSubmenu:
        type: toggle
        text: Include a submenu?
      subMenu:
        type: pages
        label: Submenu items
        when:
          hasSubmenu: true
1 Like

Hi, thanks - have it now! Have a nice evening and thanks!
Here once more a functioning whole site yml file if somebody needs it
Sry 4 crossposting, is deleted.

title: Site

columns:
  left:
    width: 2/3
    sections:
      # sections in the left column

      pages:
        type: pages
        headline: Öffentliche Seiten
        status: listed
        
      unlisted:
        type: pages
        headline: Versteckte Seiten
        status: unlisted
      
      drafts:
        type: pages
        headline: Unfertige Seiten
        status: draft
        
  right:
    width: 1/3
    fields:
      menu:
        type: structure
        fields:
          mainMenu:
            type: pages
            label: Mainmenu item
            max: 1
          hasSubmenu:
            type: toggle
            text: Include a submenu?
          subMenu:
            type: pages
            label: Submenu items
            when:
              hasSubmenu: true
1 Like