Modular Page only for one page site?

I have pages and blog pages functioning and would like to buildout couple of sections that take advantage of modular page content.

This is in the modular page:

title: Infinite Architecture
menu: Infinite Architecture
intro: A collection of paintings
content:
    items: '@self.modular'
    order:
        by: default
        custom:
            - _intro
            - _alpha-centuri
            - _constellation
            - _nebula
            - _leaf_falling

This is in the modular.html.twig

{% extends 'partials/base.html.twig' %}
{# This is a template to build a modular page of  art objects or design projects. #}
{% block body %}
{# Can we make this any simpler? #}
{% for module in page.collection() %}
    {{ module.content }}
{% endfor %}
{% endblock %}

I end up with no errors, just a blank place where content should be. (Are there twig tools to see whether a collection is being returned, rejected etc.?

Many thanks!

@FrederickYocum, Welcome to the forum!

Your question seems to consist of two parts:

  • Are modular pages only for so called ‘one-page’ sites?
  • Are there any Twig debugging tools.

Are modular pages only for so called ‘one-page’ sites?
No, not necessarily, although the docs may lead to that conclusion. At least I did draw that conclusion…

The advantage of modular pages are:

  • Better oversight of the sections of the page.
  • Easier editing of smaller distinct sections
  • Easier changing the order of sections.

Are there any Twig debugging tools
Yes there are.

  • There is a section in the docs about Debugging/Logging
  • You can also use {{ var_dump(page.collection) }}, which will literary dump the content into the page. It requires less setup though.

@pamtbauu

Many thanks for pointing me at the debugging tools, this has helped with stamping out some unrelated issues I did not even know existed.

The non display problem, was solved by changing block body to block content Human error me thinks.