# Sitesearch embedded JavaScript - custom rendering of result page

**URL:** <https://discuss.elastic.co/t/sitesearch-embedded-javascript-custom-rendering-of-result-page/247771>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [September 7, 2020, 11:57am UTC](https://discuss.elastic.co/t/sitesearch-embedded-javascript-custom-rendering-of-result-page/247771 "2020-09-07T11:57:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elio1](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@elio1](https://discuss.elastic.co/u/elio1)\
**Post date:** [September 7, 2020, 11:57am UTC](https://discuss.elastic.co/t/sitesearch-embedded-javascript-custom-rendering-of-result-page/247771/1 "2020-09-07T11:57:05Z")

</div>

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](https://github.com/swiftype/swiftype-search-jquery/blob/master/jquery.swiftype.search.js))  
like in the JQuery-module?

```auto
<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

---

<div class="post-metadata">

**Author:** ![constancecchen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/constancecchen/32/71762_2.png) [@constancecchen](https://discuss.elastic.co/u/constancecchen)\
**Post date:** [September 9, 2020, 8:54pm UTC](https://discuss.elastic.co/t/sitesearch-embedded-javascript-custom-rendering-of-result-page/247771/2 "2020-09-09T20:54:10Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 7, 2020, 8:54pm UTC](https://discuss.elastic.co/t/sitesearch-embedded-javascript-custom-rendering-of-result-page/247771/3 "2020-10-07T20:54:12Z")

</div>

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