Gravatar for

Question by kmelkez, Jun 10, 2014 3:31 PM

Helper functions with JSrender


Is it possible to use Result Template Helpers with JS-render engine ?

I try to use it like this :

{{:~highlight(excerpt, excerptHighlights)}}

but I have the following error :

Error: undefined is not a function.

Any ideas ? Thx

1 Reply
Gravatar for

Answer by Martin Laporte, Jun 10, 2014 4:37 PM

Took me a while to figure this out, but try loading the jsrender library after the Coveo.Dependencies file but before CoveoJsSearch. JsRender needs jQuery (which is in .Dependencies), but must be loaded before our main runtime in order for the template helpers to be registered (I'll clarify this in the doc).

Gravatar for

Comment by kmelkez, Jun 11, 2014 10:00 AM

Thanks ! Works fine

Ask a question