Embedded Widget Options

About all options of the embedded widget integration

The next options can be added to the script:

window._sn.widgets.push({ 
engineid: '-insert-your-engine-id',
-- insert your options here --
});

Labels (optional)

Gives you the possibility to provide your own translations for specific text in the widget.

Usage: (below is the current default text labels)

labels: {
searchButtonText: "Search",
refineResultsLabel: "Filter",
showResultsLabel: "{0} results found for '{1}'. Showing page {2} of {3}.",
noResultsLabel: "No results found for '{0}'",
searchfieldPlaceholder: "What are you searching for?"
},

Placeholders for showResultsLabel:

  • {0} = Number of results
  • {1} = Search keywords
  • {2} = Current page
  • {3} = Total pages


Placeholders for noResultsLabel

  • {0} = Search keywords

 

Autofocus (optional)

When loading the widget autofocus will give focus to the keywords input field after the first initialize. Sometimes this is not desired so you can set autofocus to false.

Usage:

autofocus: default(true),

Using on 404 page (optional)

This optional feature enables the widget to give search results based on the URL of the 404 page. No search form will be shown.

Usage:

is_404_widget: default(false),

 

Disable styles

This disabled the default process of interpreting colours and styles from the parent HTML element.

Usage:

disableStyles: default(false),
Styling
Methods / Events