Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

searchBoxConfig

searchBoxConfig is controlling the behavior of the search box on search.

Options

  • If using Sitefinity CMS the Search box configuration could be updated by adding JSON object with the options the Data filed of Hawksearch widget designer Advanced options. Example:

    Code Block
    {"_searchBoxConfig":{"reloadOnEmpty":false,"redirectOnEmpty":false,"redirectToCurrentPage":false}
  • updating the config:

    Code Block
    const hawkConfig = {
          ...
           searchBoxConfig: {
                reloadOnEmpty: true,
                redirectOnEmpty: true,
                redirectToCurrentPage: true
            },
          ...
    };
    
    var widget = HawksearchVue.createWidget(component, { config: config});
    
    HawksearchVue.initialSearch(widget);

reloadOnEmpty

  • default value false

  • if true refresh the search results with an empty keyword, but keeps all other facet selections. This is available if a results widget is dropped on the same page.

redirectOnEmpty

  • default value false

  • if trueredirects to the results page even if the search field doesn’t have a keyword

redirectToCurrentPage

  • default value false

  • if true and If the set redirect page is the current one, forces the page to reload

...