---
title: "Widget variation rules"
slug: "widget-variation-rules"
abstract: "Overview of widget variation rules in Sitecore Discover."
---
# Widget variation rules

Widget variation rules are an essential part of the widget variation framework. A rule in a widget variation defines how the variation appears and behaves.

> [!note]
> A widget variation without any rules automatically inherits those from the active variation of the global widget.

A rule typically includes definitions for context, merchandising, and general widget settings. Rules for recommendation widgets include recipes.

<details>
<summary><h2>Context</h2></summary>

A rule's context defines the criteria for a rule to apply. There are two types of context:

- Site context defines where in the site a visitor must be for the rule to take effect.
- Visitor context defines the segment of visitors to which the rule applies.

If you do not set a context, the rule applies to all site areas and to all visitors. After setting a context for a rule, the rule editor screen displays a sample set of items that visitors fitting that context see.

> [!note]
> You can set rule context in all widgets including the global widget.

</details>

<details>
<summary><h2>Recipes</h2></summary>

For recommendation and email recommendation widgets, you use *recipes* to configure how results are generated. Recipes are AI-driven algorithms for trends, popularity, and conversions. You can custom craft recipes to address specific merchandising needs.

> [!note]
> You can only set recipes for recommendation and email recommendation widgets.

</details>

<details>
<summary><h2>Merchandising</h2></summary>

You can customize results and their display in a widget, by applying [merchandising strategies](https://doc.sitecore.com/discover/en/users/discover-user-guide/pages-and-widgets/merchandising-strategies.html "Merchandising strategies") similar to the following:

- Filter for an attribute and its value.
- Filter for keywords.
- Pin an item or category to a specific slot in the widget's display.
- Boost, bury, and blacklist items and categories.

</details>

<details>
<summary><h2>Settings</h2></summary>

In the **Settings** section of a rule, you can customize or configure the display of a widget. The following lists some typical examples.

- Defining layout and user experience of banner and HTML widgets.
- Configuring user interactivity, facets, and sorting options in search results widgets.
- Displaying trending categories and search ranking options in preview search widgets.

</details>