FreeMarker IF statement
11 December 2025 (Updated 11 December 2025)
On this page
Basic IF
<#if someVar>
<section>Special section</section>
</#if>
Safe IF check (handle missing variables)
<#if someVar?? && someVar>
<section>Special section</section>
</#if>
IF ELSE
<#if source == "a">
Content A
<#elseif source == "b">
Content B
<#else>
Default content
</#if>
Tagged:
Misc