> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Templates UI configuration options

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/lucidworks-search/07-improve-your-queries/curate-search-experience/predictive-merchandiser/templates-ui-configuration-options

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/07-improve-your-queries/curate-search-experience/predictive-merchandiser/templates-ui-configuration-options

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/tnm7lt

The Templates screen in the Rules Editor allows you to design, test, and implement a wide variety of search experiences. Results are conditionally delivered from multiple different query pipelines, enabling you to optimize search, browse, and AI-driven functionality throughout your site.

<LwTemplate />

## Configuration options

### Templates

When creating or editing a template, the status is indicated after the template name.

<img src="https://mintcdn.com/lucidworks/VKnUHJXP6sWH55ak/assets/images/5.6/stale-example-56.png?fit=max&auto=format&n=VKnUHJXP6sWH55ak&q=85&s=de2e10bf12829c4e9d13b6f902868279" alt="Template active status" width="2354" height="1305" data-path="assets/images/5.6/stale-example-56.png" />

The active status can hold the following values:

| Tag         | New | Saved | Published | Active |
| ----------- | --- | ----- | --------- | ------ |
| **Editing** | ✅   |       |           |        |
| **Stale**   |     | ✅     |           |        |
| (nothing)   |     |       | ✅         | ✅      |

Configuration options for templates:

| Option                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Precedence            | If multiple templates are triggered, this setting determines which template is displayed. Lower numbers are considered higher precedence. For example, a template with precedence of `999` will trigger before a template with precedence of `1`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Display Name          | The name of the template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Type                  | The type of template. This is an arbitrary value classifying the template. It has no effect on triggering/rendering logic unless the value is `Typeahead`. If `Typeahead` is assigned, the template will be excluded from `/trigger` and `/render` endpoints. This value is read-only and for informational purposes only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Zones                 | Determines which zones are loaded when the template is triggered. Zones are displayed in the order they appear.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Triggering            | The conditions that must be met for the template to display<br />• **Date Range.** Define a date range to trigger the display of the template. For example, a desired template may be set to display during a Black Friday sales event.<br />• **Trigger.** Define triggers to trigger the display of a template. Triggers are added with the **Trigger** button<br />• **Search Term.** Search terms required in the query for this trigger to match. The configured analysis will be applied to tokenize and process these terms.<br />• **Match Mode.** Defines search terms matching criteria<br />• `phrase` requires the search tokens of this trigger to exist as a phrase within the search terms of the query. The phrase must be in the same order.<br />• `all` requires the search tokens of this trigger to exist within the search terms of the query in any order.<br />• `exact` requires that the search tokens in this trigger exactly match the search tokens in the query *in the same order*. As with all match modes, `exact` still applies the configured analysis, such as stemming. Singular and plural forms will be considered identical despite not being *exactly* the same.<br />• **Filters.** Filters (`fq`) values required in the query for this trigger to match. Additional filters may be present and still satisfy this trigger.<br />• **Exact.** If **On**, the nav state must match this trigger’s criteria exactly—no extra filters or terms allowed if none are defined. (Not to be confused with `exact` match mode.)<br /> |
| Matches All Locations | If set to **On**, this template is always displayed, and triggers are ignored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

#### Triggering

The date range trigger is activated alongside triggers with an `AND` logical operator. Conversely, triggers are activated alongside other triggers with an `OR` logical operator. For example, consider the following scenarios:

| Scenario 1  |                | Scenario 2  |                                        |
| ----------- | -------------- | ----------- | -------------------------------------- |
| Date Range  | *none*         | Date Range  | `November 25, 2020 - December 5, 2020` |
| Search Term | `cyber monday` | Search Term | `cyber monday`                         |
| Search Term | `sales event`  | Search Term | `sales event`                          |

In **Scenario 1**, no date range is configured. The template is triggered if:

* The user searches the term `cyber monday` *or* `sales event`.

In **Scenario 2**, a date range is configured. The template is triggered if:

* Today’s date is within the date range `November 25, 2020 - December 5, 2020`, *and* the user searches the term `cyber monday`
* Today’s date is within the date range `November 25, 2020 - December 5, 2020`, *and* the user searches the term `sales event`

The template is *not* triggered if:

* Today’s date is not within the date range `November 25, 2020 - December 5, 2020`
* Today’s date is within the date range `November 25, 2020 - December 5, 2020`, but the user does not search the term `cyber monday` *or* `sales event`

### Zones

| Option                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Display Name            | The name of the zone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Type                    | An arbitrary value classifying the zone. It has no effect on triggering/rendering logic. Intended only to be used by the PM UI. This value is read-only and for informational purposes only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Query Profile           | Determines query profile the zone will fetch results from.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Tags                    | Tags are passed to the query profile when rendering. They are combined with tags found in the request parameters of the render request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Omit Filters from Query | If set to **On**, the filters (`fq`) are ignored. For example, if you want the zone to display items with type `sunglasses` even though the user has filtered the results to `shorts`, enabling this setting allows the zone to display sunglasses.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| UI Treatment            | Arbitrary text included in the response when rendering the zone. Generally used by the frontend to determine how to display the zone. UI Treatment tags accept a color value to help distinguish them in the Predictive Merchandiser screen: <Frame> <img src="https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.3/ui-treatment.png?fit=max&auto=format&n=tklssWuUmNaxlF0b&q=85&s=05bcebf5cb22f4abeed79c52d8b4665a" alt="UI Treatment example" width="2336" height="833" data-path="assets/images/5.3/ui-treatment.png" /> </Frame> |
| Results Layout          | Select grid or list view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Display Fields          | Add field names and how they are displayed (type of field).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Product Image           | Field name for the product image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Product Title           | Field name for the product title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Product Description     | Field name for the product description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

<Note>
  Product Image, Product Title, and Product Description are only used to render products in Predictive Merchandiser. Your search application will determine what fields are used in production.
</Note>
