Hi Team,
I'm trying multiple if conditions for my code. as far as i know the below conditional check
value ="${properties.val1 ? properties.val1 : inheritedPageProperties.val1}">
for this i need to add another default value , like if the value is present in component dialogue it should take from component else it should take from rootpage properties. If the value is not preset in both component and rootpage then I need to give my own default value?("some text").
how can I do this ?
Solved! Go to Solution.
Views
Replies
Total Likes
@Tessa_learner1 You can wrap your ternary expression in parenthesis and use an OR (||) condition to achieve this.
${(properties.val1 ? properties.val1 : inheritedPageProperties.val1) || 'Default'}
<sly data-sly-set.value="${properties.val1 ? properties.val1 : inheritedPageProperties.val1 || 'default value'}"></sly>
you can try this way.. In this ternary condition if ${propertise.val1} is not present then it will check ${inheritedPageProperties.val1} and if ${inheritedPageProperties.val1} this value is also not present then it will take the default value provided by OR(||) condition
@Tessa_learner1 You can wrap your ternary expression in parenthesis and use an OR (||) condition to achieve this.
${(properties.val1 ? properties.val1 : inheritedPageProperties.val1) || 'Default'}