How to get javascript callback in template


could you by chance provide a simple example how to get a javascript function called in order to render a part of a (hit in this case) template? I need to modify some strings based on some other object properties (nothing fancy, but not doable without if * / + etc). indicates I need to put it in the hash, but I can’t seem to see where that is…


To do logic on how to display items before rendering the template, we have the transformData option in InstantSearch.js. This allows for a cleaner structure than doing that inside the Hogan template rendering itself.

We also have the option to use a function as HitsTemplate, this allows you to do that same rendering yourself, and doesn’t force you into using Hogan.

I hope that helped, but don’t hesitate to ask for more information!