Defining Filter Rules

In this topic, you will learn how to build filters.

A filter contains one or multiple rules and condition(s) that define when the rules are applied to the original site page.

Rules are added directly to the filter, while conditions are specified separately in triggers.

Note

The green indicator on the filter title shows that the filter is active and applied to the site.

Building Rules

Each rule contains:

  • Definition of the DOM object that should be processed. It is specified in the Input field. To select the DOM element, use the button available in the field.
  • The action should be performed by the rule. It is selected from the drop-down list in the Processing field.
  • DOM element definition, CSS class name, attribute, etc. that should be available on the resulting site page. It is specified in the Output field.

Refer to the Filter Manager topic to learn more about the actions and definitions of elements that can be used in filter rules.

Using Snippets in Rules

Such rule actions as Replace by Snippet, Add Snippet Before, Add Snippet After, Prepend Snippet, Append Snippet allow using snippets while processing original site content.

To use a snippet in a filter rule:

  1. Open Filter Manager by clicking Filter Manager on the left sidebar.

  2. Expand the filter you need by clicking on filter title.

  3. Specify the DOM element that should be processed using a snippet, in the Input field.

  4. Select the action in the Processing field that requires using snippets (Replace by Snippet, Add Snippet Before, Add Snippet After, Prepend Snippet, Append Snippet).

  5. Click the Open Snippet button in the Output field.

  6. Select the snippet you need from the list of available snippets.

    Note

    If you need a new snippet, enter its name and click the Create button to add another snippet to the project.

    Select snippet

Applying Triggers

Triggers define conditions when the filter rules are applied. You can add one or more triggers to your filter. To do that:

  1. Open Filter Manager by clicking Filter Manager on the left sidebar.

  2. Expand the filter you need by clicking the filter title.

  3. Click + Add Trigger.

  4. Select the trigger you need from the list.

  5. Specify whether the filter should be applied when all conditions defined by triggers are met or only some of them, by clicking All or Any in the Execute Filter for field.