Modular page in menu does not display ints children

@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…