The isOffline
field in my websetting object is a boolean type. In my Freemarker template, I need to check if it's true of false.
So I did the following, but it does not work
<#if !websetting.isOffline> false </#if>
It looks like Freemarker does not support the Not !
. I've also tried <#if websetting.isOffline == false> false </#if>
, but it's not working.
The isOffline
isn't the best name for a boolean property because the default getter method for it is also isOffline
.
If you cannot change the name of the property then show that you want to call method in template with ()
.
<#if !websetting.isOffline()> false </#if>
But it is better to change name to something w/o is
in front of it (e.g. to offline
). Then you can use it in template.
<#if !websetting.offline> false </#if>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With