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

Multiple Collections

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

Hi there,

Grave allow Multiple Collections, i wanna define my own collection. I defined it within a page header. does it also need to be defined in yaml file? i have no idea where to define the yaml file. Could you help for this, thank you

10 years ago

I have problem to access the custom collection which i defined in page header. So i have doubt that does i need to defined it in yaml file.
my code to access just like this:
{% set fruit_collection = page.collection('fruit') %}
{% for child in page.fruit_collection %}
{{ child.url }}
{% endfor %}

10 years ago

Hi,

I would say:

TWIG
{% for child in fruitcollection %}

Your fruitcollection is already a page object.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2289 9 years ago
Archive · by Muut Archive, 9 years ago
2 1504 9 years ago
Archive · by Muut Archive, 9 years ago
2 4754 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