Usage: {{#post}}{{/post}}
or {{#foreach posts}}{{/foreach}}
post.hbs
or page.hbs
, outputting the details of your posts can be done with a block expression.
The block expression {{#post}}{{/post}}
isn’t strictly a ‘helper’. You can do this with any object in a template to access the nested attributes e.g. you can also use {{#primary_author}}{{/primary_author}}
inside of the post block to get to the primary author’s name and other attributes.
When inside a post list such as index.hbs
or tag.hbs
where there is more than one post, it is common to use the {{#foreach post}}{{/foreach}}
to iterate through the list.
When inside a {{#foreach posts}}{{/foreach}}
or {{#post}}{{/post}}
block (i.e. when inside the post scope), theme authors have access to all of the properties and helpers detailed on this page.
{{#post}}{{/post}}
block expression, and all the same helpers you can use for a post.
{{#if featured}}{{/if}}
to test if the current post is featured.