Adding site search to a site template/page and redirecting the results

  1. Go to template or page where search needs to be inserted

  2. Go to Components and select Site Search

  3. It will say code is copied. This is what the code will look like:
    site-search-code
    {% component source: “Page”, layout: “Site Search List”, displayPagination: “true”, type: “site_search” %}

  4. Paste the code into the div where you want the site search to be.

  5. You can redirect to a page where the search results are shown by changing to
    ie. The name of the page you want the search result to show on.

If you do that you need to put the search results code on the search results page, and remove it from under the search form.

{% component source: “Page”, layout: “Site Search List”, displayPagination: “true”, type: “site_search” %}

  1. So the full code is now:

IN TEMPLATE/PAGE WHERE SEARCH BAR NEEDS TO BE:
site-search-code2

ON SEARCH RESULT PAGE eg: /search-page.htm
{% component source: “Page”, layout: “Site Search List”, displayPagination: “true”, type: “site_search” %}

NOTE: Search results will paginate automatically with this code.

More documentation here: https://docs.treepl.co/documentation_group/component-types/site_search
Liquid Components > Site Search