Skip to main content

Substitution exclusions

Substitution exclusions allow you to make exceptions to the substitution rules you have set. This can be useful when, for example, you want to replace a certain image everywhere except in one specific place.

How substitution exclusions work

Substitution exclusions work in a similar way to substitutions, but have a higher priority. So when an element of your website is under an exclusion, all other rules will no longer be executed for that element.

Adding a substitution exclusion

You can add a substitution exclusion by opening your clone within the control panel and then clicking on the Exclusions button in the side menu. On this page you can manage two different types of exclusions: translation exclusions and substitution exclusions. To manage substitution exclusions, go to the second tab. You will then see this screen:

Substitution exclusions

The table is similar to that of substitution rules, but it does not have a replacement field. To add a new exclusion, enter the fragment to be excluded from substitution rules in the original field. You can also use the same Case insensitive, Regular expression, and Single word options for this.

Creating a substitution exclusion

Usually you will want to create an exclusion for one particular substitution rule. The easiest thing to do then is to use the original of that substitution rule as the starting point for your exclusion. Then you expand the context of the original to include the element (or elements) to which the exclusion should apply, but not the elements to which the substitution rule should apply. It is best to expand the context at the beginning.

Example

Suppose you have set a rule for your clone that everywhere on your clone the word Netherlands should be replaced by Belgium. You use the following substitution rule for this purpose:

Original

Replacement

Options

However, you also have a page with address data:

https://example.nl/contact
...
<div class="contact-info">
<p class="ui-address">
Dorpsstraat 6
1234AB Heerhugowaard
Nederland
</p>
</div>
...

You would then not want to replace Netherlands by Belgium in the address. You can then make the following substitution exclusion to avoid that:

Original

Options

In the example above, the context of the substitution rule is extended by adding the rule before it. This makes the exclusion more specific to that element. Note that the white space in the source code has also been over-named. If you do not do this the created exclusion will not work.