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

To get started using Dynamic Texts - see our getting started guide here


Variables

Below is a list of supported variables. We're constantly adding more to the list.

Variable Type Value
$TITLE$ String Black Feedr T-shirt
$DESCRIPTION$ String Black Feedr T-shirt in a very soft material
$BRAND$ String Feedr
$PRODUCTTYPE$ String Clothing
$REGULARPRICE$ Integer 2500 (in cents)
$SALEPRICE$ Integer 1500 (in cents)
$PRICE$ Integer 1500 (in cents)
$ONSALE$ Boolean true
$QUANTITY$ Integer 59
$DISCOUNTPERCENTAGE$ Integer 40 (percentage)
$DISCOUNT$ Integer 1000 (in cents)


Functions

When using Dynamic Texts it's often useful to wrap your variables in functions and format the output accordingly. Below is a list of currently supported functions and a few examples.

Function Arguments Example Output (example)
@LIMIT(VARIABLE Limit Append)@ VARIABLE: Variable to limit
Limit: Number of allowed characters - Default of 50
Append: Append to the end of truncated text - Default of ...

@LIMIT($DESCRIPTION$ 11)@ Black Feedr...
@PRICE(VARIABLE Decimals DSep TSep)@

Outputs the price in dollars - dividing by 100
VARIABLE: Variable to format (in cents)
Decimals: Number of decimals - Defaults to 0
DSep: Decimal seperator - Default to , (comma)
TSep: Thousand seperator - Default to . (period)

@PRICE($PRICE$)@
@PRICE($PRICE$ 2)@
@PRICE($PRICE$ 2 .)@
@PRICE(100000 2 . ,)@
15
15,00
15.00
1,000.00
@NUMBER(VARIABLE Decimals DSep TSep)@

Outputs the number without dividing
VARIABLE: Variable to format
Decimals: Number of decimals - Defaults to 0
DSep: Decimal seperator - Default to , (comma)
TSep: Thousand seperator - Default to . (period)

@NUMBER($PRICE$)@
@NUMBER($PRICE$ 2)@
@NUMBER($PRICE$ 2 .)@
@NUMBER(1000 2 . ,)@
1.500
1.500,00
1.500.00
1,000.00

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 @ENDIFCONTENT 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  @ENDIFThe product is on sale and the shipping is free
@IF($ONSALE$ = true || $QUANTITY$) Buy it now before it's too late @ENDIF Buy it now before it's too late
@IF($REGULARPRICE$ < 2000 || $ONSALE$ = true && $SALEPRICE$ < 2000) This product is one of our cheap ones @ENDIF This product is one of our cheap ones