In the Gantry5 modular.html.twig template it contain the following code:
{% block content %}
{{ page.content|raw }}
{% for module in page.collection() %}
<div id="{{ macro.pageLinkName(module.menu) }}">
{{ module.content|raw }}
{% endfor %}
</div>
{% endblock %}
I want to modify it so it will use the body_classes tag on a modular page. In some themes this seems to work automatically like in the bootstrap4 theme. The code is almost identical.
{% block content %}
{{ page.content|raw }}
{% for module in page.collection() %}
<div class="modular-anchor" id="{{ macro.pageLinkName(module.menu) }}"></div>
{{ module.content|raw }}
{% endfor %}
{% endblock %}
I thought changing the Gantry5 template to use the following would work but it refuses to recognize the page.header.body_classes tag.
<div class="{{ page.header.body_classes }}" id="{{ macro.pageLinkName(module.menu) }}"></div>
Is there a different method to adding the body_classes tag to the modular templates? If I manually add class="myClsss" instead of the body_classess tag it works.
Thanks.