Pagination on separate page

Hey everyone!

So as of lately I’ve developed a Ghost theme for a client of mine, the issue I’m having is that on a custom page template I’m trying to utilize pagination. By calling out {{pagination}}

This separate page is a custom page and I’m getting the post by using the get and a foreach loop to show them.

My only problem is that when I call out for pagination inside that {{get}} nothing happens.

Here is a gist of the code on the page that I’m trying to get pagination to work for.

Any answers or guidance would be very much helpful!

Thank you in advance for reading!

Hi @Dilion_Smith,

If you are using the {{get}} helper, you get the 6 posts and that’s it.
Is this page set up via a collection or channel in routes?
If yes, then you would not need the {{get}} helper, just the {{foreach}} and you also have access to {{pagination}}.

Thank you for your reply!

No, this page is not added to collection or channel in routes.

I worked on it a bit yesterday, I’m having difficulty getting it work when creating the collection.

So I have the home page which is index.hbs and the blog page which is page-blog.hbs

What should my routes.yaml file look like if I want the pagination to work on that page?

Thank you in advance!

If you defined the collections correctly and you have enough posts, the pagination should work.

I would suggest checking out the official docs about routing, you will find some examples there:

Maybe share your current routes setup and a link to your site.