Closed shukriadams closed 6 years ago
Indirectly found a clue from the _renderTemplate : function(template, context, options) hook.
the fix is
_helpers.render= function (partialName, data, options) {
var template = options.data.exphbs.partials[partialName];
if (!template)
throw new Error('Missing partial ' + partialName );
return template(data, options.data.exphbs, options);
};
Turns out the required engine context is options.data.exphbs, as all the helpers are attached to that object.
Inside a keystone.js app, I'm using a helper that renders a partial by name. The rendering works, but the partial seems to missing global context - I cannot call any custom helpers from it.
And I call this with
Anyone know what I'm missing? I'm actually trying to do something more complex but for the sake of brevity all I need to get working is the above.