How to say if something equals to a string in Sightly?

Hello Universe picture Hello Universe · May 22, 2015 · Viewed 9.1k times · Source

In Sightly, I want to have if statement as in below

if x == "Australia"
then

execute the html below

I am looking for some tutorial on how to do this or some example. This may not be worth asking here. However, please, may I have an example like that? I am stuck

Answer

khakiout picture khakiout · May 22, 2015

I think you could do something like this:

<div data-sly-test="${x == 'Australia'}">
    HTML about Australia
</div>

Here are some tutorials as well:

http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-1/