Problem with page collection headers

Can anyone help me make the page collections work? I can make a page that lists all the children its own folder, but I can’t make a page that lists all the files in a different folder.

I’m trying to follow the guidance in

I have stripped my page files to the bare bones but still can’t see the problem. These are the bare bones files:


The file has the following headers, and works fine.

title: animalsV1
     items: @self.children

The associated template listthings1.html.twig produces a list of animals. Fine.

The problem is with the file. It has these headers, and doesn’t work:

title: animalsV2`
        '@page': '/03.animalsV1'

The two associated templates are exactly the same except for a diagnostic message to print the name of the template. Here is the listthings2.html.twig template:

{% extends 'partials/base.html.twig' %}

{% block content %}
<p>listthings1 template</p>
	{{ page.title}}
	{{ page.content }}
		{% set collection = page.collection() %}
			{% for child in collection %}
				<li><a href="{{ page.url }}/{{ child.slug }}">{{ child.title }} </a></li>
		    {% endfor %}
{% endblock %}

I can tell from the diagnostic that the file has been used, but it produces no list of animals.

I have tried some variations in the header, but to no avail.

Presumably I have misunderstood something. Does anyone have a working example of the '@page': 'filename' construction?

Thanks in advance,

The @page takes a route (ie, what shows in the URL) not a file path as you have it with the numeric prefix. So probably should be:

title: animalsV2
        '@page': '/animalsV1'

Bingo. Thanks.