Module within Module

Hi all,

For a single page project I would like to use a module in a module, but im not entirely sure if that will actually work out how I imagined.

The one page layout is working fine, consisting of 3 different modules shown on a modular page. Now the idea is to break down one of the modules in two separate modules.

Would this be possible with Grav?

I think you can achieve following with taxonomies. This is how i done it in SoraArticle theme (see sidebar, it’s exactly as you requested, another modular layout):

{% for module in page.collection({'items':{'@taxonomy.category': 'sidebar'},'order': {'by': 'default', 'dir': 'asc'}}) %}
   <h2 class="title">{{ module.title }}</h2>
    {{ module.content }}
{% endfor %}

Then in your .md file you have to specify taxonomy:

taxonomy:
    category: sidebar

This way I loaded another modular layout for “sidebar” module. You can have as many different taxonomies as you want which allows basically to create unlimited modular layouts on the same page.

So simple… can’t believe i missed the option to use taxonomies! Thanks a lot!