Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Can't get modular collection in another page

Started by Muut Archive 10 years ago · 1 replies · 503 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 2288 9 years ago
Archive · by Muut Archive, 9 years ago
2 1500 9 years ago
Archive · by Muut Archive, 9 years ago
2 4753 9 years ago
Archive · by Muut Archive, 9 years ago
1 3570 9 years ago
Archive · by Muut Archive, 9 years ago
3 1627 9 years ago