Hi all,
I'm trying check whether both the fields are present in the dialog using or condition. It is failing how can I use 'or' condition in data-sly-test for fields renditions in single div.
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral}" || data-sly-test="${contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
I tried above statement but its failing. Can anyone help me with this?
Thank you
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @keerthana_hn ,
The syntax is incorrect as if you need to add OR condition sly-test you can write as below.
<div data-sly-test="${condition 1 || condition 2}">
Please try as below:
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral || contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
Hope this helps!!
Thanks
Hi,
Please try
<p data-sly-test="${properties.jcr:title || properties.myTitle}">My Text</p>
or
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral || contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
However this or condition can be checked in model and passed as a boolean to be checked in the html
Hi try
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral || contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
Hi @keerthana_hn ,
The syntax is incorrect as if you need to add OR condition sly-test you can write as below.
<div data-sly-test="${condition 1 || condition 2}">
Please try as below:
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral || contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
Hope this helps!!
Thanks
@keerthana_hn In your query ( i copied it below) you need to remove the characters marked in bold letters
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral}" || data-sly-test="${contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
AS others mentioned it should be
<div data-sly-test="${contentFragmentMap.elementsMap.twitterLinkGeneral || contentFragmentMap.elementsMap.linkedinLinkGeneral}" class="cmp-auth-profile__social-buttons">
Thanks
Veena
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies