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

Can't get modular collection in another page

Started by Muut Archive 10 years ago · 1 replies · 443 views
10 years ago

Hi there,
I'm trying to get modular subpages in an another page, but it's not working, the array I get is empty...

Here's the frontmatter of the page where I want to get the modular subpages :

YAML
title: 'page title'
template: custom
content:
    items: 
        '@page.modular': '/modular-page'

the twig in the template :

TWIG
{% for p in page.collection %}
     <h2>{{ p.title }}</h2>
{% endfor %}

and the modular.md frontmatter :

YAML
title: Modular Page
onpage_menu: true
body_classes: ""

content:
    items: '@self.modular'
    order:
        by: default
        dir: asc
        custom:
            - _modular-section-1
            - _modular-section-2
            - _modular-section-3
            - _modular-section-4

Am I missing something ?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2951 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago