Release Notes / Version 10.2107
Table Of Contents
The value of
cm.UNDEFINED
(e.g. provided by the corresponding Freemarker macro) is now treated in a special way on template side, so various build-ins like
?has_content
and
?length
now produce a more reasonable result when used in conjunction with
cm.UNDEFINED
.
The goal is to reduce overhead when writing templates. In most cases you want to check if a given value is not undefined and not empty. Instead of having to check both you can now just check if the value is not empty. This also applies to iterating over a possibly UNDEFINED value. Just use
<#list>
instead of checking for undefined first.
Upgrade Steps:
Please check your templates and make sure that they still produce the correct result after the following changes :
cm.UNDEFINED?has_content
now returns false instead of true.${cm.UNDEFINED} now outputs an empty String instead of
UNDEFINED
.cm.UNDEFINED == "UNDEFINED"
now returns false instead of true.(optional) Remove checks that are no longer needed (e.g. before
?has_content
and<#list>
)
Please also note that if you need to check for
cm.UNDEFINED
exactly, consider using the function
cm.isUndefined(someValue)
.
You do not need to make any adjustments outside of templates as the special treatment only applies when rendering Freemarker templates.
(CMS-14250)