Hi,
I’m working on constructing a modular page, and would appreciate some direction.
This is what I am wanting:
essentially the page should be constructed in two steps: fill in the modular content, then fill in the children pages content. The modules will be block level and fill the whole horizontal space. The child pages will be displayed as a grid, and maybe paginated. The pagination is the last thing on the list, I need to get the rest of it working first.
[ base ]
[ module ]
[ module ]
[ module ]
[ module ]
[c] [c] [c] [c]
[c] [c] [c] [c]
[c] [c] [c] [c]
[c] [c] [c] [c]
[c] [c] [c] [c]
Is this the right approach? Should I be thinking of these things as modules and children? Is the terminology correct?
You can tell that I am trying to follow the example in the docs.
01.page
. . . _callouts
. . . . . . text.md
. . . _features
. . . . . . text.md
. . . _highlights
. . . . . . text.md
. . . _showcase
. . . . . . text.md
. . . 01.test01
. . . . . . product.md
. . . 02.test02
. . . . . . product.md
. . . 03.test03
. . . . . . product.md
. . . 04.test04
. . . . . . product.md
. . . modular.md
This is my front matter:
---
title: Test Mod
content:
items: '@self.modular'
order:
by: default
dir: asc
custom:
- _showcase
- _highlights
- _callout
- _features
products:
items: '@self.children'
filter:
published: true
type: 'product'
order:
by: default
dir: asc
---
This is my work-in-progress modular.html.twig:
{% extends 'partials/base.html.twig' %}
{% block content %}
{% for module in page.collection() %}
{{ module.content|raw }}
{% endfor %}
{% for blurb in page.products() %}
{{ blurb.content|raw }}
{% endfor %}
{% endblock %}
It populates the navigation bar. I don’t want that. I think I can fix that in the product.md front matter.
The modular section shows up, but the child pages section doesn’t show up.
Any quick pointers or tips would be appreciated! I think I can work this all out, but I definitely wouldn’t mind some tips to speed up the process