{"category":{"version":"58810495d172b61b00d73859","project":"542fe92a5eceb608003fddc8","_id":"58810495d172b61b00d7385d","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-04T12:45:40.548Z","from_sync":false,"order":3,"slug":"helper-reference","title":"Helper Reference"},"parentDoc":null,"project":"542fe92a5eceb608003fddc8","user":"542c5cfcddd3190e00228849","version":{"__v":1,"_id":"58810495d172b61b00d73859","project":"542fe92a5eceb608003fddc8","createdAt":"2017-01-19T18:25:25.206Z","releaseDate":"2017-01-19T18:25:25.206Z","categories":["58810495d172b61b00d7385a","58810495d172b61b00d7385b","58810495d172b61b00d7385c","58810495d172b61b00d7385d","58810495d172b61b00d7385e","58810495d172b61b00d7385f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.11.4","version":"0.11.4"},"_id":"58810495d172b61b00d73870","__v":0,"updates":["5471598c208b72080024afa4"],"next":{"pages":[],"description":""},"createdAt":"2014-10-04T12:53:19.029Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":20,"body":"Ghost has a number of built in helpers which give you the tools you need to build your theme. Helpers are classified into two types: block and output helpers.\n\n**[Block Helpers](http://handlebarsjs.com/block_helpers.html)** have a start and end tag E.g. `{{#foreach}}{{/foreach}}`. The context between the tags changes and these helpers may also provide you with additional properties which you can access with the `:::at:::` symbol.\n\n**Output Helpers** look much the same as the expressions used for outputting data e.g. `{{content}}`. They perform useful operations on the data before outputting it, and often provide you with options for how to format the data. Some output helpers use templates to format the data with HTML a bit like partials. Some output helpers are also block helpers, providing a variation of their functionality.\n\n\n## Helper Listings\n\nThere are a number of different types of helper in Ghost. The types give some background information on how the helpers work or what they do, each helper has a list of types in its documentation which will link back here. For more information on the different expressions you may see wrapped in curly braces within Ghost themes, see the [handlebars expressions guide](http://themes.ghost.org/docs/handlebars#section-handlebars-expressions).\n\n### All\n\n[{{foreach}}](doc:foreach), [{{has}}](doc:has), [{{is}}](doc:is), [{{get}}](doc:get), [{{content}}](doc:content), [{{excerpt}}](doc:excerpt), [{{tags}}](doc:tags), [{{author}}](doc:author),\n[{{image}}](doc:image), [{{navigation}}](doc:navigation), [{{pagination}}](doc:pagination),\n[{{url}}](doc:url), [{{date}}](doc:date), [{{plural}}](doc:plural),\n[{{encode}}](doc:encode), [{{asset}}](doc:asset),\n[{{body_class}}](doc:body_class), [{{post_class}}](doc:post_class),\n[{{ghost_head}}](doc:ghost_head), [{{ghost_foot}}](doc:ghost_foot),\n[{{meta_title}}](doc:meta_title), [{{meta_description}}](doc:meta_description), [{{next_post}} & {{prev_post}}](doc:prev_next_post),  [{{log}}](doc:log), [{{if}}](doc:if), [{{unless}}](doc:unless)\n\n### Required\n\nRequired helpers must be included in a theme. Any theme which does not use all of the required helpers are considered invalid themes.\n\n[{{asset}}](doc:asset), [{{body_class}}](doc:body_class),\n[{{post_class}}](doc:post_class), [{{ghost_head}}](doc:ghost_head),\n[{{ghost_foot}}](doc:ghost_foot)\n\n### Block\n\nBlock helpers require both an opening and closing tag like `{{#has}}{{/has}}`. A full explanation of block helpers can be found in the [Handlebars](/docs/handlebars#block-expressions-scopes-) section.\n\n[{{foreach}}](doc:foreach), [{{has}}](doc:has), [{{is}}](doc:is), [{{author}}](doc:author)\n\n### Async\n\nThese helpers make use of Promises (asynchronous operations) as part of their work behind the scenes. This can cause limitations, and there is a known issue with Async helpers not working when they are nested.\n\n[{{get}}](doc:get), [{{next_post}}](doc:prev_next_post), [{{prev_post}}](doc:prev_next_post),\n[{{ghost_head}}](doc:ghost_head), [{{ghost_foot}}](doc:ghost_foot), \n[{{amp_ghost_head}}](doc:amp_ghost_head), [{{amp_content}}](doc:amp_content)\n\n### Query\n\nQuery helpers perform a request to the API to get extra data for your theme. When using a Query helper, you will get access to additional data to that listed in the [context table](/docs/context-overview#context-table).\n\n[{{get}}](doc:get), [{{next_post}}](doc:prev_next_post), [{{prev_post}}](doc:prev_next_post)\n\n### Debugging\n\n[{{log}}](doc:log)\n\n### Ghost\n\nThis means the helper was added by Ghost, rather than being part of Handlebars\n\n### AMP\n\nAMP helpers are specifically made for `amp` posts. You'll find the documentation on the [AMP feature](doc:amp) page.\n\n### Handlebars\n\nThese helpers are core to the Handlebars templating language, meaning you may find more documentation about them elsewhere.\n\n### Template-driven\n\nTemplate helpers have a special partial template in Ghost core which they use to render their output. This template can be overridden by including a correctly named template in the partials folder of your theme. Details of the template are always documented with the helper.\n\n[{{navigation}}](doc:navigation), [{{pagination}}](doc:pagination),\n\n### Output\n\nOutput helpers are simple helpers which aid with common tasks when outputting data for themes, like listing tags. They often have options for configuring the output.\n\n### Formatting\n\nFormat helpers provide tools for nicely formatting bits of data, like dates. They often have options for configuring how the data is formatted.","excerpt":"","slug":"helpers","type":"basic","title":"Helper Overview"}
Ghost has a number of built in helpers which give you the tools you need to build your theme. Helpers are classified into two types: block and output helpers. **[Block Helpers](http://handlebarsjs.com/block_helpers.html)** have a start and end tag E.g. `{{#foreach}}{{/foreach}}`. The context between the tags changes and these helpers may also provide you with additional properties which you can access with the `@` symbol. **Output Helpers** look much the same as the expressions used for outputting data e.g. `{{content}}`. They perform useful operations on the data before outputting it, and often provide you with options for how to format the data. Some output helpers use templates to format the data with HTML a bit like partials. Some output helpers are also block helpers, providing a variation of their functionality. ## Helper Listings There are a number of different types of helper in Ghost. The types give some background information on how the helpers work or what they do, each helper has a list of types in its documentation which will link back here. For more information on the different expressions you may see wrapped in curly braces within Ghost themes, see the [handlebars expressions guide](http://themes.ghost.org/docs/handlebars#section-handlebars-expressions). ### All [{{foreach}}](doc:foreach), [{{has}}](doc:has), [{{is}}](doc:is), [{{get}}](doc:get), [{{content}}](doc:content), [{{excerpt}}](doc:excerpt), [{{tags}}](doc:tags), [{{author}}](doc:author), [{{image}}](doc:image), [{{navigation}}](doc:navigation), [{{pagination}}](doc:pagination), [{{url}}](doc:url), [{{date}}](doc:date), [{{plural}}](doc:plural), [{{encode}}](doc:encode), [{{asset}}](doc:asset), [{{body_class}}](doc:body_class), [{{post_class}}](doc:post_class), [{{ghost_head}}](doc:ghost_head), [{{ghost_foot}}](doc:ghost_foot), [{{meta_title}}](doc:meta_title), [{{meta_description}}](doc:meta_description), [{{next_post}} & {{prev_post}}](doc:prev_next_post), [{{log}}](doc:log), [{{if}}](doc:if), [{{unless}}](doc:unless) ### Required Required helpers must be included in a theme. Any theme which does not use all of the required helpers are considered invalid themes. [{{asset}}](doc:asset), [{{body_class}}](doc:body_class), [{{post_class}}](doc:post_class), [{{ghost_head}}](doc:ghost_head), [{{ghost_foot}}](doc:ghost_foot) ### Block Block helpers require both an opening and closing tag like `{{#has}}{{/has}}`. A full explanation of block helpers can be found in the [Handlebars](/docs/handlebars#block-expressions-scopes-) section. [{{foreach}}](doc:foreach), [{{has}}](doc:has), [{{is}}](doc:is), [{{author}}](doc:author) ### Async These helpers make use of Promises (asynchronous operations) as part of their work behind the scenes. This can cause limitations, and there is a known issue with Async helpers not working when they are nested. [{{get}}](doc:get), [{{next_post}}](doc:prev_next_post), [{{prev_post}}](doc:prev_next_post), [{{ghost_head}}](doc:ghost_head), [{{ghost_foot}}](doc:ghost_foot), [{{amp_ghost_head}}](doc:amp_ghost_head), [{{amp_content}}](doc:amp_content) ### Query Query helpers perform a request to the API to get extra data for your theme. When using a Query helper, you will get access to additional data to that listed in the [context table](/docs/context-overview#context-table). [{{get}}](doc:get), [{{next_post}}](doc:prev_next_post), [{{prev_post}}](doc:prev_next_post) ### Debugging [{{log}}](doc:log) ### Ghost This means the helper was added by Ghost, rather than being part of Handlebars ### AMP AMP helpers are specifically made for `amp` posts. You'll find the documentation on the [AMP feature](doc:amp) page. ### Handlebars These helpers are core to the Handlebars templating language, meaning you may find more documentation about them elsewhere. ### Template-driven Template helpers have a special partial template in Ghost core which they use to render their output. This template can be overridden by including a correctly named template in the partials folder of your theme. Details of the template are always documented with the helper. [{{navigation}}](doc:navigation), [{{pagination}}](doc:pagination), ### Output Output helpers are simple helpers which aid with common tasks when outputting data for themes, like listing tags. They often have options for configuring the output. ### Formatting Format helpers provide tools for nicely formatting bits of data, like dates. They often have options for configuring how the data is formatted.