Bonjour,
Pourriez-vous ajouter la possibilité de mettre des variables dynamiques connectées aux databases dans des portions des éléments texte, et non sur la totalité de l’élément texte. Cela se fait déjà dans les Shoutout et les Automations, alors pourquoi pas dans l’éditeur?
#featurerequest #texte #database
That can easily be achieve with lodash template https://lodash.com/docs/4.17.15#template
import _ from "lodash";
import wixWindow from "wix-window";
$w.onReady(() => {
//select the text depending on the formFactor
let instructions = wixWindow.formFactor === "Desktop" ? "click" : "tap"
//create the template based on the initial text
//instruction initial text is "For more info ${instruction} here"
var compiled = _.template($w("#mapInsctructionsText").text);
//Compile the template with the variable value 'instructions'
$w("#mapInsctructionsText").label = compiled({instructions});
}
Thank you but I don’t understand how does it work…
@tchiron maybe have a look at this https://www.wix.com/corvid/reference/$w.Text.html#text