Gravatar for matthieu.keromen@gmail.com

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

Helper functions with JSrender

Hi,

Is it possible to use Result Template Helpers https://developers.coveo.com/display/JsSearch/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 mlaporte@coveo.com

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 matthieu.keromen@gmail.com

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

Thanks ! Works fine

Ask a question