Accessing Collections in Twig

Hi,
I did not understand the page collection that can be accessed in twig template in this link - https://learn.getgrav.org/content/collections.

I am learning with antimatter theme. I created a listing page using blog.md and made the collection in the blog.md frontmatter. But, in the section accessing collections in twig it says : Grav creates a collection page.collection that you can access in a twig template with:

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

In which file is this code contained in? in the blog.html.twig ?

This is only an example of how you would access the collection in Twig.

The part of antimatter that is similar is contained in blog.html.twig, line 22.

Let me know if that clears it up for you.

Thanks for replying. I got it. I guess I will have to look up the documentation of twig so that I can stop asking these silly questions.

Not stupid, it’s easy to misread the docs when you have pre-existing ideas :slight_smile: