Layout assignments for search terms

You might want to customize the layout of the search results page for a specific search term. If so, you can create a layout and assign it directly to the search term. When a customer uses the search term to search your site, the search results page is rendered with your assigned layout instead of the default layout for the search results page.

The following example shows the Search terms table in the Commerce Composer tool, where a layout is assigned to the search term laptop:
Figure 1. Assigning a layout to a search term

Assigning a layout to a search term
Tip: This scenario is different from typical layout assignments because you are assigning the layout directly to the search term, not to a page, even though the search results page is affected.

Commerce Composer widgets for search results pages

The widget library that is included with the Commerce Composer tool provides various widgets that you can use in a layout that is assigned to a search term. The following widgets provide the features of a typical search results page:

You can also use widgets that are marked with an X in the Widgets for any page column in Commerce Composer widget library.

Synonyms for search terms

By default, layout assignments are extended to synonyms of the search term that you specify. The Commerce Composer tool checks for any existing synonyms that are defined in the Catalogs tool as search term associations. You can add new synonyms in the Catalogs tool whenever they are required. For more information, see Creating search term associations using synonyms and replacements.
Here is an example of how a layout assignment is extended to the synonyms of a search term:
  • You create a layout to use as the search results page for laptop computers.
  • You assign your layout to the search term laptop, as shown in Assigning a layout to a search term.
  • In the Catalogs tool, you set up the following synonyms for the search term laptop: laptops, notebook, notebooks
As a result, the layout is used on the storefront when a customer searches by using any of the following search terms:
  • laptop
  • laptops
  • notebook
  • notebooks

In the Store Management tool, a Use synonyms check box controls whether the layout assignment is extended to synonyms of the search term as described here. This store function is enabled by default, but you can disable the function if required. The Use synonyms check box is on the Configurations tab in the Store Management tool. For more information, see Selecting store functions.

Important: When you specify search terms and synonyms, include all variations of the term that you expect customers to use. For the layout to be assigned, the customer's search term must be an exact match to the search term or synonym.

Comparison: using the Catalogs tool to link a search term to a content page

Management Center offers another method for displaying a layout when a customer uses a specific search term to search your store. For this alternative method, you must complete these steps:
  1. In the Commerce Composer tool:
    1. Create a content page (a page URL) to use as a search landing page.
    2. Create a layout for the landing page and assign it to the content page.
  2. In the Catalogs tool, link the URL for the content page to the search terms. For more information, see Linking and unlinking search terms with landing pages.

If you use this method:

  • Widgets that depend on the search term to display data will not work correctly. For content pages, the search term is not passed into the widget, so the widget cannot display the search-related data. All of the widgets that are listed earlier in this topic depend on the search term.
  • You cannot run web activities in the widgets that depend on a search term. An example is a web activity that uses the Search Criteria and Results target.