Merge conditionals

How to use conditionals in order to show or hide content

Merge supports conditionals and operators that can be used in conjunction with standard placeholders to create powerful combinations, providing a great deal of flexibility. By utilizing conditionals, users can set specific criteria that dictate when certain pieces of content should be displayed, allowing for tailored messaging based on varying situations. Operators further enhance this capability by enabling complex logical expressions, such as combining multiple conditions or performing comparisons. Together, these features empower users to craft dynamic and context-sensitive outputs, ensuring that the information presented is not only relevant but also highly engaging for the audience. This combination of conditionals and operators enhances the overall functionality of Merge, making it an invaluable tool for creating customized content.

If structure

  • if  fn:if value operator value marks the start of the if block. If the value operator value returns true, the data between the start end end blocks is displayed
  • endif  fn:endif marks the end of the if block

Operators

  • fn:if value1 = value2
  • != fn:if value1 != value2
  • > fn:if value1 > value2
  • >= fn:if value1 >= value2
  • < fn:if value1 < value2
  • <= fn:if value1 <= value2

 

Example of conditionals in a template: