nenadstupar_
I'm new here

Replace legacyIf after migration from v4 to v5?

What will be syntax of this function for version 5?

<CMS_FUNCTION name="legacyIf" resultname="global_trim_level">

  <CMS_VALUE_PARAM name="conditionVar" value="Global.preview"/>

  <CMS_PARAM name="compareValue" value="1"/>

    <CMS_CDATA_PARAM name="trueValue">4</CMS_CDATA_PARAM>

    <CMS_CDATA_PARAM name="falseValue">4</CMS_CDATA_PARAM>

</CMS_FUNCTION>

0 Kudos
2 Replies
Peter_Jodeleit
Crownpeak employee

Since the "if" here is not needed (both cases are equal), you could simply write $CMS_SET(global_trim_level, 4)$. Generally you can use CMS_IF as replacement for "legacyIf".

[Corrected, replaced CMS_VALUE with CMS_SET - thank you @ felix.reinhold​]

Peter
0 Kudos

Small addition: I think Peter accidently wrote CMS_VALUE but meant CMS_SET Smiley Happy

0 Kudos