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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Page collections not working - syntax as written to header is wrong? (v1.8)

admin

Started by Julien 1 year ago · 1 replies · 65 views
1 year ago

GRAV v1.8.0-beta.4 here. I'm creating a template and blueprint for a modular page that is supposed to show teasers/cards for other pages. Think showing a list of links to blogs, or news articles, etc.

I'm extending the modular blueprint to inherit the "Module setup" fields that let the user setup the page collection.

Now, let's say I want to show all child pages of /news. According to the documentation, that can be achieved with either '@page.children': '/news' or [email protected]: '/news'. Neither of them work. I've also tried all kinds of variants, omitting the single-quotes for the first or second part, adding them to none or both. Nothing works.

Looking at the page's markdown, the relevant, generated header field ends up looking like this:

YAML
content:
    items: "'@page.children': '/news'"

Again, I've tried editing this to where it doesn't have the double-quotes, etc, but nothing seems to work. Page collection always empty.

However, if I edit this manually and change it to a two-liner, as is also shown in the documentation, it works, the page collection gets populated correctly:

YAML
content:
    items:
        '@page.children': '/news'

Unfortunately, whenever someone uses the Admin panel to edit this page/module, this will get changed back to the one-line syntax, and the page collection will be empty, nothing shows.

Is this a bug in v1.8 or am I missing something much simpler here?

last edited 02/04/25 by Julien

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1136 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago