How to handle else/if condition in sightly : Bit Urgent
[Thread Edited By Adobe]
/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here.
Go ahead and to it now: https://adobe.ly/3eDnB4v */
Actual Post:
Hi All,
In my sightly code I have two page properties which I am successfully getting from my Java WCMUse class.
${bean.getProperty1} and ${bean.getProperty2}.
I am able to print these values.
#1] However, inside <p></p> tag, I need to have a logic such that it should check if ${bean.getProperty1} is available. If yes, print that , else print the second property.
I am trying the below :
#2] <p class="article-label">"${bean.getProperty1}?${bean.getProperty1}:${bean.getProperty2}"</p>
But its not coming up properly on the page. By that I mean say value1 and value2 are corresponding properties and if property1 is present its printing "value1?value1:" on the page, rather than just a single value.
Any thoughts/pointers on this will be very helpful.
