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 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
Below is a list of supported variables. We're constantly adding more to the list.
|$TITLE$||String||Black Feedr T-shirt|
|$DESCRIPTION$||String||Black Feedr T-shirt in a very soft material|
|$REGULARPRICE$||Integer||2500 (in cents/øre/etc.)|
|$SALEPRICE$||Integer||1500 (in cents/øre/etc.)|
|$DISCOUNT$||Integer||1000 (in cents/øre/etc.)|
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.
This function is used to truncate texts into a maximum number of characters. If the maximum amount of allowed characters is reached a string is appended like '...'.
Syntax: @LIMIT(VARIABLE Limit Append)@
|@LIMIT($DESCRIPTION$ 11)@||Black Feedr...|
|@LIMIT($DESCRIPTION$ 20 ......)@||Black Feedr T-shirt|
|@LIMIT($DESCRIPTION$)@||Black Feedr T-shirt|
This function is used to format prices in a readable format instead of the lowest possible unit like cents, øre, etc. by dividing by 100.
Syntax: @PRICE(VARIABLE Decimals DecimalSeperator ThousandSeperator)@
|@PRICE($PRICE$ 2 .)@||15.00|
|@PRICE(100000 2 . ,)@||1,000.00|
This function is used to format a readable format much like @PRICE@ but without dividing by 100.
Syntax: @NUMBER(VARIABLE Decimals DecimalSeperator ThousandSeperator)@
|@NUMBER($PRICE$ 2 .)@||1.500.00|
|@NUMBER(100000 2 . ,)@||1,000.00|
Conditions are a key part of Dynamic Texts. Conditions lets you show one text in one scenario and another text in a different scenario (e.g only show "on sale" if the product is on sale). 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 off with the syntax and explain each statement later.
|@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 meet.|
|@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|
Please note that all statements must be closed with @ENDIF@.
A CONDITION contains three parts. A VARIABLE, OPERATOR, and VALUE to check against. Below is a list of different supported operators.
|=||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|
Now let's setup a few examples for each type of statement and see how it actually works.
|@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$ < 10) 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|