Dynamic Texts - Overview

20 minutes read

Dynamic Texts is one of our more advanced features for companies and agencies who wants to write dynamic and flexible content without the hassle of editing every single product and keeping each product maintained. Dynamic Texts let you modify product content regardless of scale. Due to our wide range of supported sales channels and growing support for e-commerce platforms, we discovered our users' need for such a feature. Dynamic Texts is built with scalability, flexibility, and accessibility in mind while providing you with a powerfull tool.

Please note this article is not a guide but a reference to Dynamic Texts

Conditions

Conditions are a key part of Dynamic Texts. I some cases, you may wish, to show one text and another text in a different scenario. This is possible using conditions - also referred to as statements. Statements are also functions by definition, but due to the wide range of possibilities, we've made a dedicated section to explore the topic in detail.

Let's start of with the syntax and explain each statement later.

Statement types

Explanation

@IF(CONDITION) CONTENT @ENDIF

This might be the most simple statement possible. This statement checks if the CONDITION in parenthesis is true.The CONTENT will only show if CONDITION is true.

@IF(CONDITION) CONTENT @ELSE ALTERNATIVE @ENDIF

If CONDITION is true the CONTENT will show otherwise the ALTERNATIVE will show.

@IF(CONDITION1 && CONDITION2) CONTENT @ENDIF

CONTENT will only show if both conditions are true

@IF(CONDITION1 || CONDITION2) CONTENT @ENDIF

CONTENT will show if either CONDITION1 or CONDITION2 is true

@IF(CONDITION1 || CONDITION2 && CONDITION3) CONTENT @ENDIF

CONTENT will show if CONDITION1 is true or if both CONDITION2 and CONDITION3 is true

Operators

A CONDITION contains three parts. A VARIABLE, OPERATOR, and VALUE to check against. Below is a list of different supported operators.

Operator

Description

Example

Output (example)

=

Check if the VARIABLE equals

@IF($BRAND$ = Feedr) Product from Feedr @ENDIF

Product from Feedr

<

Check if the VARIABLE is smaller than

@IF($PRICE$ < 10000) Costs less than $100 @ENDIF

Costs less than $100

>

Check if the VARIABLE is larger than

@IF($PRICE$ > 100) Costs more than $1 @ENDIF

Costs more than $1

STARTSWITH

Check if the VARIABLE starts with

@IF($TITLE$ STARTSWITH Black) It starts with Black @ENDIF

It starts with black

ENDSWITH

Check if the VARIABLE ends with

@IF($TITLE$ ENDSWITH T-shirt) It ends with T-shirt @ENDIF

It ends with T-shirt

CONTAINS

Check if the VARIABLE contains

@IF($TITLE$ CONTAINS T-shirt) This is a t-shirt @ENDIF

This is a t-shirt

NOCONTAINS

Check if the VARIABLE does not contain

@IF($TITLE$ NOCONTAINS Shoe) This is not a shoe @ENDIF

This is not a shoe

Examples

Now let's setup a few examples for each type of statement and see how it actually works.

Example

Output

@IF($PRICE$ > 1000) The product costs more than $10@ENDIF

The product costs more than $10

@IF($ONSALE$ = false) The product is not on sale @ELSE The product is on sale @ENDIF

The product is on sale

@IF($ONSALE$ = true && $PRICE$ > 1000) The product is on sale and the shipping is free @ENDIF

The product is on sale and the shipping is free

@IF($ONSALE$ = true || $QUANTITY$) Buy it now before it's too late @ENDIF