Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Macros with page collections

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

Hello! I have this peace of code:

TWIG
{% for page in page.find('/xyz').collection('content_package-nr_1') %}
     {{ page.content }}
{% endfor %} 

The only thing what changes here is .collection('nameX'). I have a page with X of collections in it. My question is, how to this with macros? In the end the result could be somehting like:

TWIG
{% for page  in page.find('/xyz').collection() %}
   {{ _self.loop(page) }}
{% endfor %} 

Hope i made my question clear enough )

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 676 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5338 9 years ago
Archive · by Muut Archive, 9 years ago
1 4135 9 years ago