Solution needed for a theme/plugin like Learn2 extended version

Hello guys,
I’m writting a kind of extended Learn2 theme. The idea is creating a site to reading books online. It’s structure is quite simple.

Root

  1. Overview page
    — > Category as menu
    — > Listing of books inside each category.

  2. Books
    — > Chapter 1

    — > Chapter 9000

some books will looks like

2-1. Books
— > Section 1 (Chapter 1 -> 50)
------ > Chapter 1

------ > Chapter 50
— > Section N

So, could you please tell me is that structure available to do with Grav?
I’m just new to this CMS :slight_smile:

Thanks.

Hi, any kind of structure is possible in Grav. There are no limits :slight_smile:

You could use this pages structure:

pages
  01.home
  02.contact
  03.books
    my-first-book
      01.chapter1
        chapter.md
      ...
      book.md
    my-second-book
      01.chapter1
        chapter.md
      ...
      book.md
    books.md

So you have 3 page types: 2 collections (books.md listing book.md pages, book.md listing chapter.md pages)

Those page types need a corresponding template in your theme.

Each collection page can simply list its children pages.

That’s a start.

1 Like

Hi @flavio,

Thanks for your reply, it makes more sense to me now.

I’m wondering is there any tutorial which I could look into when I’m getting started? Something like the relationship between components of Grav or just a tutorial about how to build a blog from scratch with Grav. So I can know more how user/pages work with user/themes and so on…

Regards,
Toan

These 2 entries in the cookbook should be helpful:

https://learn.getgrav.org/cookbook/tutorials/create-a-blog

https://learn.getgrav.org/cookbook/general-recipes#migrate-an-html-theme-to-grav

1 Like