Skip to main content

Embedding

This demo shows search results embedded into a block on the page instead of an overlay. Search for hummus or chicken nuggets to try it. View the ss360Config to check the configuration.

  • results.embedConfig.contentBlock is the CSS selector of the element the results are rendered into.
  • Add results.embedConfig.url to send searchers to a dedicated search results page first, for example url: '/search'.

See Search results for all results options.

window.ss360Config = {
siteId: 'spoonacular.com', /* Replace with your site id */
searchBox: {
selector: '#searchBox' /* Replace with the css selector of your search box */
},
results: {
embedConfig: {
contentBlock: '.example__page-content-block' /* Replace with the css selector of the DOM element you want to use */
}
}
};
{"siteId":"spoonacular.com","searchBox":{"selector":"#searchBox"},"results":{"embedConfig":{"contentBlock":".example__page-content-block"}}}