Hello Universe
Hello Universe

Reputation: 3302

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

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

Upvotes: 1

Views: 12145

Answers (1)

khakiout
khakiout

Reputation: 2400

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/

Upvotes: 7

Related Questions