Closed sleekdevelopment closed 5 years ago
@sleekdevelopment You would need to do something like this:
{{if(options.someval === "somevalue")}}
Display this!
{{#else}}
{{if(options.someotherval === "someothervalue")}}
Display this!
{{#else}}
They don't equal
{{/if}}
{{/if}}
You could also define your own helper, say you called it IF
:
Sqrl.defineNativeHelper('IF', {
helperStart: function (param) {
return 'if(' + param + '){'
},
helperEnd: function () {
return '}'
},
blocks: {
elseIfConditionA: function () {
return '}else if (options.someOtherThing === true) {'
}
}
})
{{IF(options.someval === "someothervalue")}}
Display this!
{{#elseIfConditionA}}
They don't equal
{{/IF}}
Here's a CodePen demo I put together as well: https://codepen.io/nebrelbug/pen/NENaga Hope this clears things up!
@sleekdevelopment I'm going to close this now. Hope you were able to find a good solution!
I tried to implement else if block. is it possible ?