Open Samyssmile opened 1 year ago
Ist it possible with the newest version?
OOB, No. The above might not even possible with Handlebars.
I recommend decorating the model (e.g. wrapping) or using JMustache Lambdas which are very powerful as they allow stack access.
I'll add code later but you could make a generic Condition builder lambda.
{{#a}}
{{#cond}}
{{#or}}
{{#b}}
{{#test}}
Finally do your or logic here.
{{/test}}
{{/b}}
{{/or}}
{{/cond}}
{{/a}}
But I imagine that might be a little too verbose for your liking so I think decorating is your best option.
I want to achieve something like this pseudecode
if(a != null || b !=null) peter else{ jackson }
Ist it possible with the newest version?