@Adil_Osama_Rasheed helpers are not located in the theme layer (e.g. Casper). The {{> "post-card"}} you referred to previously is not a helper it’s a “partial” that you can find in “partials” folder here hope this is what were looking for!
Thanks Gargol .
Do you have idea how posts are being fetched? I am not able to figure out how the post-public controller is called and what workflow is being followed to fetch posts?
I have a question in the same context as above and perhaps anyone of you can help.
So, I just installed Ghost 3.0 locally and I am not able to figure out how, index.hbs is serving posts in the way it’s serving, i.e., 1 first row then next row has 3, then 2, then 1 and then 1 in another format. Where is this styling coming from?
I would like to create my own index,hbs maybe with 2 posts, side by side and then paginate! Can you please guide me the right direction?
Okay, so has {#has index=“nth:6”} should do it for every 6th post and not 1st? So it should be 3,3,0 ! What am I missing here?
Secondly, I read the documentation again I am a bit confused by this paragraph:
The number of posts provided will depend on the post per page setting which you can configure in your package.json file. The array will provide the correct posts for the current page number, with the posts ordered chronologically, newest first. Therefore on the home page, the theme will have access to the first 6 posts by default. On /page/2/ the theme will have access to posts 7-12.
My post per page are set to 25(default); so is it post per page in batches of 6? So every time {{#foreach ‘posts’}}{{/foreach}} executes it runs just 6 times? Then where is the outer loop of post per page?
The style say post-card-large should take up a full row. Every sixth post gets this class (so post 1, 7, 13, etc)
By default, a post card takes up ~ 1/3 of a row
With the large post, and 3 small posts, you have 4 posts. There are 2 more posts available before the 7th post (which is a full row), so their are only 2 posts in the third row. The styles say that the card width should be maximized to fill the row, so they’re wider
No, there are 25 posts fetched
For every post
IF it’s a 6th index (as in factor of six), it has the post-card large class
In styles (once the html is sent to your browser), the layout is determined by the post width logic I mentioned above.
If you have 25 posts displayed, your last post will also be big (though it won’t look the same as the post-card-large posts) since the css tells the browser to make the card take up as much space as possible
Thanks again for your answer! I get it that every sixth gets this class, since index starts at 0, so it should be 0,6,12 and so on.
Question: So, 0 get’s it by default, correct? If I want to skip 0 and do something on 1, I should do
{{#has index="1"}}
Also, for all even posts:
{{#has number="nth:2"}}
This will do 2,4,6,… correct?
What if I wanna do something every Odd post? So: 1,3,5, and so on