Hubspot and Template Implementation

Hey Algolia community-

I’m trying to get a search query to populate from the search box on every page and show results on a single results page. I have most of the code - it works when hosting it locally on my machine - but when I go to implement in Hubspot the result values are missing. For some reason Hubspot does not like the {{{ }}} coding.

Here is my code:


Here’s what is displayed for search results:


To achieve what you want, you need to escape the HubSpot delimiters {{}} like this:

    templates: {
      hits: {% raw %}'text and {{{some_variable}}}'{% endraw %}

Anytime you need to have {{ or {{{ being written as it in your JavaScript code then you need to escape it otherwise HubSpot will try to interact with it.

Here’s the documentation for this:

Thanks for using Algolia!

1 Like

That worked perfect. Thanks so much for the guidance.