inside my author.hbs i’m using the helper {{#author}} wich to be honest i’m not sure what it does
after closing the helper {{/author}}
I’m doing a each helper to go through the posts (this is why i don’t understand what the author helper does since i’m using the posts after i close it…)
{{#each posts }}
My problem is,
I have no idea why posts only has 11 posts in it, when the author has over 60…
also, i’m not sure how to filter by the language tag (since authors will often post in multiple languages, and i want to be able to only show the language that the user wants)
When visiting authors.hbs, there are several pieces of relevant data that are available.
There’s the author data, which includes the author’s name, profile image, bio, etc. You access the author data via {{#author}}. This opens up the author context so that data like name, website, bio, and so on is accessible.
In addition to the author’s data, we also have access to their posts. When looping through the posts in Ghost, use the {{#foreach}} helper (not each). Ghost Handlebars Theme Helpers: foreach
The last (relevant) bit of data available is pagination. Not all posts by the author are served by default to optimize performance. Instead, a limit is defined in the theme’s package.json file. in your case, it sounds like that limit is 11.
Ghost provides the pagination helper as an easy way for the user to go to the next page of an author’s posts.
First of all, super helpful stuff and detailed answer thank you! will change the each to the foreach helper
I do see the 11 on package.json! is there a way could bypass this 11 without setting the limit to 1000? or how could i implement the pagination so that the user can scroll down and fetch the next 11? that would actually be mega awesome for my use case
also, could you tell me how is this “posts” variable being populated to begin with? is it automagicly?
I just joined a company and they’re using ghost and it’s honestly the first time i touch this kind of technologies
The post limit (11) affects all paginated routes: the home page, author pages, and tag pages. I mention this because making a change in package.json will also make a change on all these pages, too.
Loading additional posts on scroll is possible and called “infinite scroll.” The technique for achieving this is more advanced, though. It requires using the get helper in conjunction with some custom JavaScript.
The infinite scroll function that I linked uses the IntersectionObserver API to handle rendering new content via scroll position. It relies on certain class names to work correctly.
Other than that, there’s not enough information in what you provided to determine what’s happening (or not).