pethel
pethel

Reputation: 5537

And in freemarker

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

Answers (2)

Goran Marinkovic
Goran Marinkovic

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

swemon
swemon

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

Related Questions