Hello everyone,
My use-case is pretty simple but I can’t seem to get it to work:
I have a home-screen with a list of all posts (default Ghost conf) and I want to add a page that will only list posts with the primary_tag:model.
As I want this page to be different than the home-page I can’t use the /tag/ url and I’ll need to use channels via the file routes.yaml has explained on the doc: Ghost Themes - Dynamic URLs & Routing
All works well except the pagination. My first 10 posts (my configuration) are listed but then I get a infinite loading.
My routes.yaml is the following:
collections:
/:
permalink: /{slug}/
template: index
routes:
/models/:
controller: channel
filter: primary_tag:model
template: models
data: page.models
And the listing file (models.hbs) is not very different from the one that is working on index.hbs.
index.hbs - pagination works
{{!< default}}
<div class="content-area">
<main class="site-main container">
{{> "partners"}}
<div class="post-feed">
<div class="grid-item grid-sizer"></div>
{{#foreach posts}}
{{> "loop"}}
{{/foreach}}
</div>
{{pagination}}
</main>
</div>
models.hbs - pagination does not work
{{!< default}}
<div class="content-area">
<main class="site-main container">
{{> "partners"}}
{{#foreach posts}}
{{> "loop-detail"}}
{{/foreach}}
{{pagination}}
</main>
</div>
I’ve searched the web for a while now and even came across this solution on the blog (How to create templates for content collections or channels with pagination? - #3 by anisul), but I can’t seem to apply this solution to my own configuration, ending with 404 errors.
Yes, I always run “ghost restart” for every routes.yaml change and I am using Ghost 5.19.0.
Can anyone please help me with this issue? I am losing hair with this one
Best regards