Views: 880 (Data available since 06.02.2017)
Last Modified: 10.10.2012

You can give your visitors two options to search the site: by using a search form and/or by providing a special search page.

Search form

The Search form in which visitors can type required keywords and quickly get results, is added to the site template by using a special component.

Click on image to enlarge

The appearance and placement of the form depend on the site design. For example, it may look like the following:

 

When a visitor clicks Search, the system performs the search and takes the visitor to a search page.

Search page

The search page contains a special field in which a visitor can type the search text. The search page also displays the search results.

Click on image to enlarge

The search page can be created by adding the special visual component (Common Search Page). This component can be added to any page when editing it in the visual HTML editor.

Click on image to enlarge

If required, you can customize the component parameters and appearance in the component property bar.

Examples of using the "Search page" component
  1. To constraint searches to only static pages, select Static files in the Restrict search area field and click OK:

    After you have clicked OK, an additional field group (URL starts with any of the following paths) will be added to the component property bar. In these fields, you can specify the folders and/or files in which the search is to be performed. For example:

  2. You can limit the search to only dynamic information. For example, your site contains a News page where the e-store news are published (using the  e-Store News information block, type News). Assume we need to allow visitors to search news.

    The following actions are to be performed to achieve this.

    • Add the Common search page component to the news page.
    • Customize the component in the following way.

      In the component property bar, select the type of information blocks in which the search is to be performed (in the Restrict search area field), and click OK.

      After that, the Search in the information blocks of type... list will appear in the property bar. In this list, select the information block (in this case, e-Store News) whose elements can be displayed on the search results page:

      Now, the search page can look like the following:



Courses developed by «Bitrix», Inc.