I’m about to create custom helpers to provide some SVG image embedding functionality, and I’ll need to know how helpers actually work to make the site efficient. Do I understand properly, that each page is generated running all the helpers in the template, and then everything is cached?
It would also be important to know what kind of context data is available in a helper? In my implementation, there would be many helper calls on each template, and all the calls would need to see the parameters of other calls. Can I do that in some way?
(I think my question is not version nor configuration dependant)
If you’re trying to embed svgs, it seems like partials will do what you’re looking for.
As far as I’m aware, the caching that’s mentioned happens at the handlebars layer - I don’t think the final page is cached (especially with members since there can be member-specific information in the page)
Cool, thank you, I checked, I think you’re right, that’s what I need.
Though I have a question regarding implementation:
As I will need to check the SVG-s for double ids for example, is it a best practice to create some script tool out of Ghost’s scope to generate the partials from the SVG-s after checking for possible mistakes like this id problem, or is there anything within Ghost’s scope for this?