Change a layer with rules
A rule changes a layer when the data of a product meets a condition. Use rules to show a badge only on discounted products, or to give the band a brand’s colour. Rules live in the Conditional Properties section of the Data Settings tab, below the data mapping of the layer.
A rule has two parts:
- An if row: a product field and a test on it, for example
brandand text equal. - One or more actions, each with its own value: what happens to this layer when the test is met.

Add and remove rules
Section titled “Add and remove rules”- Select the layer and open Data Settings.
- Click the plus button next to Conditional Properties. Once the layer has a rule, it becomes a “…” button with Add Next Condition, and the same button also appears under the rules.
- Fill in the rule, as described below.
- To add another action to the same rule, click Add Action.
A layer can have up to 20 rules. To remove one, click Remove on its if row.
Pick the field and the rule
Section titled “Pick the field and the rule”The left box of the if row is the field. It has a search box (Search Field) and these groups:
- Smart Conditions: Item is discounted and Item is not discounted. They need no rule and no value: pick one and the row is complete. Cropink decides whether an item is discounted from its price and sale price.
- Common Fields: the fields most layers use, such as
title,current_priceandimage_link. - Then the other fields of your products, grouped by type.
The right box is the rule. What it offers depends on the type of the field. Cropink takes the type from its own list of fields:
| Field type | Fields, for example | Rules |
|---|---|---|
| Text | title, brand, product_type, color |
is empty, is not empty, contains, not contains, text equal, text not equal |
| Number | sale_price, current_price, discount_percentage |
is empty, is not empty, number greater than, number less than |
| Text and number | custom_label_0 to custom_label_4 |
the text rules and the two number rules |
| Image | image_link, additional_image_link_0 |
is empty, is not empty, contains, not contains |
| List of tags | internal_labels |
is empty, is not empty, is equal any, is not equal any |
Fields that are Cropink’s own versions of a text, number or image field (such as cropink_label_0) follow the type they
copy. A field of any other kind gets only is empty and
is not empty. If you change the field to one of another type,
Cropink clears a rule that no longer fits.
Type the value
Section titled “Type the value”For every rule except the empty tests, a value box appears under the row. It is required.
- Text rules take text, for example
Kestro. The box says Text. - number greater than and
number less than take a number, for example
100. The box says Number. Use digits, with a comma or a dot for decimals. Letters and symbols are dropped as you type (not on a field that is both text and number), and a minus sign is not accepted, so a rule cannot compare with a negative number. - is equal any and is not equal any take tags (Tag). Press Enter or click away to add a tag; Backspace in an empty box removes the last one; pasted text splits at commas.
Pick the actions
Section titled “Pick the actions”Under the if row, each action row has a select (Search Action) and, for most actions, a value. When the test is met, Cropink applies the actions to this layer.
| Action | Value | Layers |
|---|---|---|
| Show | none | all except the main frame |
| Hide | none | all except the main frame |
| Change Fill Color | a colour | all |
| Change Border Color | a colour | all |
| Map To | a product field, picked as in the main data mapping | all |
| Change Text | a text | text layers |
| Change Font | a font | text layers |
| Change Font Size | a size in px, above 0 | text layers |
| Change Placeholder | an image from your team’s library | image layers (a logo is one) |
| AI Background Remove | Remove or Keep | image layers, on some accounts (see below) |
“All” means frames, rectangles, images, text and the main frame. A rule can recolour a band or a badge as well as a text. Cropink decides which actions each type of layer may have, so the list on your layer can be shorter than this one.
Three things to know:
- Each action can be used once in a rule. An action that a row already uses is missing from the other rows, and Add Action disappears when every action is taken. To use the same action twice, for example two colours, make two rules.
- A layer that is mapped to data cannot use Change Text. If you map the layer later, its Change Text actions are removed.
- The main frame, the frame that holds the whole design, can be recoloured but cannot be shown or hidden.
To map a layer to a product field, see Map layers to product data.
AI Background Remove as an action
Section titled “AI Background Remove as an action”On an image layer, AI Background Remove removes or keeps the background of the product photo when the test is met. Its value is a switch: Remove (the start value) or Keep. For example, remove the background only for the products of one category.
It is not available on every account. If your list of actions does not have it, your account does not. A design that already has this action keeps it, and its row is locked: it reads This action isn't available on your account. It stays as it is. You can still remove the row. The result does not show on the canvas or in Data Preview. You see it in the images Cropink generates. For the layer-wide switch, see Colours, gradients and images.
When several rules match
Section titled “When several rules match”Cropink does not check rules in the editor. It sends your rules, in the order they have in the panel, with the product to its server and gets back which ones are met.
If two rules can be met at once and both set the same thing on the layer, for example two fill colours, the editor does
not say which one wins. Cropink’s server decides. Write rules that exclude each other, such as
Item is discounted and
Item is not discounted, or brand equal to different brands.
Examples on Bottom Band – Classic
Section titled “Examples on Bottom Band – Classic”Show a badge only on discounted products
Section titled “Show a badge only on discounted products”In this design the badge2Box layer, a “Free returns” badge, is hidden. A rule shows it when the item is discounted.
- Select
badge2Boxand open Data Settings. - Click the plus button next to Conditional Properties.
- In the if row, open the field box and choose Item is discounted under Smart Conditions. There is no rule box and no value: the row is complete.
- In the action row, choose Show.
Check it in Data Preview. Preview NW-2421, which is discounted, and click badge2Box
in the Data Responsive Layers list. Output shows the rule as a sentence with
Condition met, and the badge is on the design. Preview NW-2400, which is not
discounted: Condition not met and the badge is hidden.
The property rows in Output, such as the one for visibility, show the settings you gave the layer in the editor, not the result of the rule. Here that row says No even while the rule is met. Trust the Condition met or Condition not met badge and the design.
To hide a layer when there is no discount, use Item is not discounted with Hide.
Give the band the colour of a brand
Section titled “Give the band the colour of a brand”The blue band frame should change colour for products of the brand Kestro.
- Select
bandand open Data Settings. - Add a rule. In the field box, search for
brandand pick it. - In the rule box, choose text equal.
- In the value box, type
Kestro. - In the action row, choose Change Fill Color. Type a hex colour,
for example
0F9D58, in the colour box and press Enter. The box shows#0f9d58and a green swatch. Click the swatch to open the colour picker instead.
Then check the rule in Data Preview. Preview NW-2435, “Kestro Pulse Bluetooth Speaker”: the band is green. Preview
NW-2421, “Stridon Court Runner Sneakers”: it stays blue. Both steps are in
Test your conditions against data.
Where you see the result
Section titled “Where you see the result”- On the Properties canvas, rules do nothing. It shows the design with placeholder data, so the badge and the band look as you drew them.
- In Data Preview, the design shows Show and Hide, and the fill and border colours that rules set, for the product you chose. Click the layer in the Data Responsive Layers list: Output lists each rule as Condition met or Condition not met.
- Other actions (Change Font and Change Font Size among them) show only in Output and in the images Cropink generates for your feed, not on the preview.
Fix a rule that is not complete
Section titled “Fix a rule that is not complete”A rule has to be complete before you publish: a field, a rule and, where the rule needs one, a value, and every action needs its value (a colour, a text, a font, an image, a size above 0). When you click Review & Publish and a rule is not complete, the editor does not open the review. It selects the first layer with such a rule, opens Data Settings and outlines the empty rule and action boxes in red. No message or window appears.
- Fill in the red boxes, or click the minus button on the rule to delete it.
- Click Review & Publish again.
The review step lists each rule as a sentence, so you can read it once more before you publish.