Sitesearch embedded JavaScript - custom rendering of result page

Hello
Is it possible to add to the following code a defaultPostRenderFunction
(swiftype-search-jquery/jquery.swiftype.search.js at master · swiftype/swiftype-search-jquery · GitHub)
like in the JQuery-module?

<script type='text/javascript'>
        (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
          (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
          e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
          })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
          
          _st('install','CODE','2.0.0',{
            install: {
                        hooks: {
                            query_filter: function(query) {
                                query.setFilterDataByDocumentTypeSlugAndFilterField(
                                    'page', 'domain-identifier', { values: '%s' }
                                    );
                                     return query;
                                    }                   
                                 }
                      }
          });
    </script>

Thanks in advance

Unfortunately not, sorry - the default st.js install code is separate from our jQuery module and does not take a renderFunction option.

If you're using the st.js embed, you can customize the appearance in the Site Search dashboard: https://swiftype.com/documentation/site-search/guides/design-and-customization

If you want very custom rendered output, you should instead switch to using the jQuery library.

Hope that helped!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.