You can install the Widget together with the Separate Results Page view. When you type your search term in the Widget’s search field, results are rendered instantly below the search field. After pressing the enter key, you will be forwarded to a separate results page.
Installing the Widget with the Separate Results Page view includes the following phases:
Creating a page depends on your CMS. Please refer to your CMS’ documentation about creating a new page or use an existing template if there is a page for search results already.
Take note of the search result page URL. You will need it when setting up the global search Widget view.
You can find the template in your CMS, usually under menus, such as “Theme,” “Template,” “Design,” “Appearance,” or similar. The templates for WordPress websites reside in the dashboard under “Appearance” -> “Editor.”
If you have an existing search on your site, go to site template edit and find your site’s search form. This is a HTML element that starts with a <form> tag, such as <form id=”search”>. Once you’ve found the relevant <form> tag, replace it and everything down to and including the closing </form> tag with the AddSearch script snippet.
You will refer to this location in the design template after you have created the search Widget script with the Search Designer in the following steps.
Follow the instructions to configure the Widget to export the scripts to the design template:
Here is an example of how the script snippet might look like (notice the last line with the results page URL):
<script> window.addsearch_settings = { "asw_01": { "show_search_suggestions": false, "search_suggestion_position": "left", "default_sortby": "relevance", "display_date": false, "display_meta_description": false, "display_result_image": true, "link_target": "_self", "hide_logo": false, "direction": "ltr", "analytics_enabled": false, "automatic_filter_results_by_site_language": false "search_results_page_url": "search-results.html" } } </script> <script src="https://cdn.addsearch.com/v5/addsearch-ui.min.js?key=####&id=asw_01"></script>
Follow the instructions to configure the Separate Results Page view and export the installation scripts to the results page:
Here is an example of how the script snippet might look like:
<script> window.addsearch_settings = { "arp_01": { "show_search_suggestions": false, "automatic_match_all_query": false, "default_sortby": "relevance", "display_category": true, "display_date": false, "display_meta_description": false, "display_results_count": true, "display_result_image": true, "display_url": false, "display_sortby": true, "link_target": "_self", "hide_logo": false, "direction": "ltr", "analytics_enabled": false, "automatic_filter_results_by_site_language": false, "facets": {} } } </script> <script src="https://cdn.addsearch.com/v5/addsearch-ui.min.js?key=####&type=search_results_page&id=arp_01"></script>
We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.