This is a total Newbie question, but I am not sure where to look for the answer. I am looking at the Modular example, and instead of using the buttons information in the showcase module to replace the header nav in the modular.html.twig, I want to iterate through the modular sections and show them as buttons inside of the showcase.html.twig.
So how do I do this? How do I get access to the “parent” modular from within the modular page
Instead of this inside showcase.html.twig
{% for button in page.header.buttons %}
<a class="button{% if button.primary %} primary{% endif %}" href="{{ button.url }}">{{ button.text }}</a>
{% endfor %}
I want to do something like this:
{% for module in page.activeParent.collection() %}
{% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
<a class="button"href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a>
{% endfor %}
Also is this TWIG syntax or PHP or Grave? What documentation should Iook at for this to understand the syntax.
ok I am almost there. I have the parent part figured out, the button shows the proper name but the link is empty. Why is the {{ _self.pageLinkName(module.menu) }} not working
{% for module in page.parent.collection() %}
{% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
<a class="button"href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a>
{% endfor %}
---