Modular page with collection in one of the modules

I’m trying to make a modular page with a collection as one of the modules.

Something like this:
Home
- Rotator (module 1)
- Tagline (module 2)
- Content (module 3)
- Capsules (collection of call to actions)

Home has an md called modular.md like this:
content:
items: '@self.modular
order:
by: default
dir: asc
custom:
- _mission
- _content
- _capsules

Capsules has an md called capsules.md like this:
content:
items: '@self.children
order:
by: date
dir: asc
limit: 3
pagination: false

Then in templates, I have a modular.html.twig. What do I do for the template for capsules? It should be in the modular folder, right, and have a regular collection?

		{% for p in page.collection %}
			<div class="col-md-4">
				<div class="capsule-gates">
					<a href="{{ p.link }}" class="btn btn-wide icon-left"><h3>{{ p.title}}</h3>		
				</div>
			</div>
		{% endfor %}

It’s not pulling the capsules, so I have something not hooked up correctly somewhere, any ideas?

Thanks!

Please include the code in triple backticks, or --- next time, to make sure the forum formats it readable.

Re-posting it here below:

I’m trying to make a modular page with a collection as one of the modules.
Something like this:

Home
– Rotator (module 1)
– Tagline (module 2)
– Content (module 3)
– Capsules (collection of call to actions)

Home has an md called modular.md like this:

content:
 items: ‘@self.modular’
 order:
  by: default
  dir: asc
  custom: 
   – mission
   – content
   – _capsules

Capsules has an md called capsules.md like this:

content:
 items: ‘@self.children’
 order:
  by: date
  dir: asc
  limit: 3
  pagination: false

Then in templates, I have a modular.html.twig. What do I do for the template for capsules? It should be in the modular folder, right, and have a regular collection?

{% for p in page.collection %}
 <div class=“col-md-4”>
  <div class=“capsule-gates”>
   <a href=“{{ p.link }}” class=“btn btn-wide icon-left”><h3>{{ p.title}}</h3>
  </div>
 </div>
{% endfor %}

It’s not pulling the capsules, so I have something not hooked up correctly somewhere, any ideas?

And the answer it, is should work with a capsules.html.twig under the templates/modular/.

You can also debug inside the capsules.md file directly, by adding

process:
    twig: true

to the page header, and

{{ dump(page.collection|length) }}

inside the page.

I don’t know if this is the problem, but the line items: ‘@self.children’ you pasted does not have valid quote symbol. != '

Thanks, I’ll try that. I didn’t know about the — either so that’s helpful.