Reputation: 5537
Is it possible to have and(&&) in freemarker or do I have to use a nested if?
<#if object?exists >
</#if>
Upvotes: 13
Views: 30624
Reputation: 31
You can use OR logic operator
<#if color == "blue" || color == "green"> We have less than 12 things, and they are green.
Upvotes: 3
Reputation: 5946
You can use && as logical operator in free maker. See Logical operations
For example
<#if x < 12 && color = "green">
We have less than 12 things, and they are green.
</#if>
<#if !hot> <#-- here hot must be a boolean -->
It's not hot.
</#if>
Upvotes: 36