Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Modular page content custom order

Started by Muut Archive 10 years ago · 3 replies · 1027 views
10 years ago

I am trying to get modular page content in a custom order, but so far, no luck. Content is displayed, but in a wrong order.

Here is a code of modular.html.twig:

TWIG
{% for module in collection %}
  <div class="row clearfix">
    <h2>{{ module.title }}</h2>
    {{ module.content }}
  </div>
{% endfor %}

Here is a modular page content:

YAML
content:
    items: '@self.modular'
    order:
        custom:
            - _contentA
            - _contentB
            - _contentC

For example, my content wil be displayed in that order contentB, contentC, contentA, but not in which I have specifically configured.

What may be the problem?

10 years ago

The custom order is based on the 'slug' of the modular pages.. that is usually based on the folder names of those modular pages. So do those match the ones you've specified in your custom order?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1360 9 years ago
Archive · by Muut Archive, 9 years ago
2 938 9 years ago
Archive · by Muut Archive, 9 years ago
2 4068 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1122 9 years ago