Is it possible to make the sub-directories foldable in the menu?

Hello,
I’m a newbie trying to set up RTFM skeleton, a sample documentation site using the learn2 theme, which really pleases me to set up a Bible reading and other books.
I’ve done some research but can’t seem to find help for this.
I have Bible folder attached to root, then sub-folders for Old Testament and New Testament. Under each of these are sub-folders to each book. Each Book by chapters containing the texts.
On the left-side menu, I would like the sub-folders to fold/unfold as the folders attached to root. Is there a way to make the subfolders fold/unfold?
Perhaps, I should use a different approach? All suggestions are welcome.
Thank you for your time.
Jan Lam

@JanLam,

trying to set up RTFM skeleton, a sample documentation site using the learn2 theme, which really pleases me

On the left-side menu, I would like the sub-folders to fold/unfold as the folders attached to root.

If you’ve already downloaded and installed the RTFM skeleton, you can see the nested folder structure in /user/pages. This folderstructure is represented als collapsible containers in the demo in the sidebar on the leftside of the site.

[…] attached to root

What do you mean by “root”? user/pages perhaps?

Have you studied Grav’s documentation on https://learn.getgrav.org/? Take a look at this sample folder structure in section Folders

Update:
I may have overlooked something. Do you mean collapsing not only the main chapters 1 Basic, 2 Content, etc, but also collapsing their nested children.
If your set variable top_level_version: true, is seems you can collapse one level deeper, but not further down. See if that fits your needs.
Maybe you can tweak theme Learn2 (a child of the theme that is), but I haven’t looked at it myself.

1 Like

Thank you so much for your reply. Yes, collapsing is the term I should use.
I would like to make the sub-folders collapse like the main top folders, as it would become very difficult to manage the huge amount of chapters that would be all displayed on the side menu.
I’ll work on this.

I accomplished this very thing with the learn2 theme… see here:

www.test.reinavaleragomez.com

The book of Genesis has what you want. I don’t have the other books like that. My structure is like this:

01.Genesis/01.chapter-1/docs.md
01.Genesis/02.chapter-2/docs.md
01.Genesis/03.chapter-3/docs.md

Etc you get the idea. This has them expand in the left hand menu for the book being viewed.

You can also add a tag in the header of the page file:

visible: true

But I’m not real sure how to get the order specified the way you want it.

2 Likes

Thank you for sharing your work. I like the way your texts are set up. Your ideas are a great help.

1 Like