Modular page in menu does not display ints children

I have a very simple text site, consisting of Home and menu-1.
I am using fresh GRAV downloaded 2019 Oct 5 with the Quark theme.

menu-1 has two subpages, each consisting of one line reporting their names. I simply want menu-1 to display its two subpages, one after the other - like the one page demo. And I have no clue what I am doing wrong.

menu-1 is modular md as follows
title: ‘Menu 1’
content:
items: ‘@self.modular

This is Menu 1

The two subpages are sub-1 and sub-2. Here is text.md from sub-1

title: ‘sub 1 of menu 1’
visible: false

This is sub 1 of menu 1

In the file structure, sub-1 and sub-2 are contained in menu-1.

When I click on menu-1, the only display is the GRAV logo.

There must be a very simple explanation, but I have struggled to find it.

Thanks for any help. Norma

@normawhite, The following is what I have understood from your question (with a few assumptions sprinkled here and there). Please correct me if I’m wrong.

It does, at least, reproduce the problem you are describing…

The folder structure:

/user/pages/
   01.home/
      default.md
   02.menu-1/
      sub-1/
         text.md
      sub-2/
         text.md
      modular.md

With the content of ‘/pages/02.menu-1/modular.md’ being:

---
title: Menu 1
content:
    items: @self.modular
---
This is Menu 1

And the content of /pages/02.menu-1/sub-1/text.md’ being:

---
title: sub 1 of menu 1
visible: false
---
This is sub 1 of menu 1

And the content of /pages/02.menu-1/sub-2/text.md’ being:

---
title: sub 2 of menu 1
visible: false
---
This is sub 2 of menu 1

If the above is a correct representation, I see the following issues:

  • No content is being shown:
    Modular sub-pages are identified by an underscore ( _ ) before the folder name. The folder names below the modular should therefore be:

    /user/pages/02.menu-1/
       _sub-1/
          text.md
       _sub-2/
          text.md
       modular.md
    

    After renaming the folder names, the contents of the child pages are shown correctly.

  • No menu is shown in page ‘menu-1’
    When looking in the console of the browser, we can see an error being thrown by Javascript trying to build the menu. Why?

    A modular page has 2 options to show a menu:

    1. Default: A menu containing the child pages of a modular: sub 1 of menu 1 | sub 2 of menu 1

      Unfortunately, you have set in both child pages visible: false, meaning: don’t show me in menu. This leads to the error being thrown.
      By removing visible:false from the child pages will solve the error and show the above menu correctly.

    2. Or a menu containing only top level pages: Home | Menu 1
      If you want this menu to be shown, add the following setting to the frontmatter of ‘/02.menu-1/modular.md’:

      onpage_menu: false  # default is true
      

Hope this helps…

Gee thanks. The main issue is that I forgot about the underscore prefix to the modular sub pages. The onpage_menu solved the menu display. visible false is what I wanted to prevent the child pages showing as sub-menu items, which works fine. Now back from the test to the my main project, I expect all to go well. Thanks again.