To make some parts of your text dynamic, you can use the variables feature. These texts are the one set directly in your widget, in the 'Messages' section or on the 'Advanced Appearances' page.
In this article, we unveil all the native variables available in the Dashboard as well as how you can create a variable on your own.
Insert a variable into some text
To insert a variable into some text, you just need to write {variable}.
For example, here we use the variable 'app_name' in the form widget's description:
Native variables
We provide several native variables, meaning they are accessible by default in your dashboard.
app_name
Allows you to display your app's name, generally your media's title.
Where can I use it?
In advanced appearances
Within messages
When editing a widget within a scenario
percent
Allows you to display the remaining percentage of text to read, set in your code beforehand. By default, it shows 80.
Where can I use it?
In advanced appearances
Within messages
When editing a widget within a scenario
count
Allows you to display the number of articles remaining in the scenario.
The Dashboard view (Advanced Appearance):
What the reader sees:
Where can I use it?
In advanced appearances
Within messages
When editing a widget within a scenario
🚨 This variable is only visible in 'test mode' or directly on your website. You cannot see the value in preview mode.
newsletter_name
Allows to display the name of your newsletter, as set in the 'Newsletter name' field.
Where can I use it?
🚨 This variable can only be used for newsletter registration.
Within messages: Newsletter form widget's description only
When editing a widget within a scenario: Newsletter form widget's description only
duration
Allows you to display the validity period of a Discovery Pass (in days). This is 30 by default.
Where can I use it?
You can use this variable 'duration' for the Discovery Pass only.
Within messages : Discovery Pass' title and description
When editing a widget within a scenario: Discovery Pass' title and description
Create your own variables
🚨 This setting requires intervention from your technical team.
To go further, you can create personalized variables and use them in the same way as the native ones.
To do so, your technical team should define these variables in your code. Don't worry though, this doesn't take long! 👉 Technical documentation
Once these variables have been created, you just need to get the variable names from your technical team. You'll then be able to use them in your texts, just like the native ones.
In the example below, we created a 'year' variable which gives the current year.
This is what we integrate in the code of our page:
From the Dashboard, we'd like to use this variable within the Messages section, in the 'Offered post' widget:
What the reader sees:
That's all there is to it 🪄