"Partials" in Ghost are snippets of code housed in small HTML files that can be used within other template files. They always live in the /partials
folder of a theme.
You can include them within a template like this:
<div>
{{> "comments"}}
</div>
This would load the HTML from partials/comments.hbs
into the page.
In some cases, you may want to pass data into a partial from the parent template file.
This is done simply by listing the data after the partial name, like this:
<div>
{{> "comments" show_something=true}}
</div>
Now the variable show_something
is true
within the partials/comments.hbs
partial file.
Thanks for reading!
I am the creator of Codelet. I have published and developed on Ghost for +5 years, on over 100 sites.
Get one-on-one Ghost support from me