I’m trying to setup dynamic routing to load a template and display all the pages (not posts) that has a specific tag. But I’m unable to get this to work. I realize I don’t fully understand the concept…
My start point was to just take the ‘tag.hbs’ template and copy that to ‘pages.hbs’
Ghost version: 2.7.1
routes.yml
routes:
collections:
/:
permalink: /{slug}/
template:
- index
/specific-pages/:
permalink: /{slug}/
template: pages
filter: page:true+tag:my-specific-tag
...
pages.hbs
{{!< default}}
...
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
...
pages.hbs (this does the job but why do I need to use the ‘{{#get}}’ helper. Should the result be filtered with the route collections filter?
{{!< default}}
...
{{#get "posts" filter="page:true+tag:mina-maskiner"}}
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
...