@ELSE

Used between a @IF and a @ENDIF to indicate the start of content to display if the @IF’s condition was FALSE.

In case @ELSEIF is also used, the content after @ELSE is displayed if every condition of the @IF and @ELSEIF are false.

Usage

<# @ELSE #>

Examples

Example With these variables Result

Text before.
<# @IF(country = “Canada”) #>
A Canadian somewhere.
<# @ELSE #>
A non-Canadian somewhere.
<# @ENDIF #>

country is "Canada"

Text before.
A Canadian somewhere.

Text before.
<# @IF(country = “Canada”) #>
A Canadian somewhere.
<# @ELSE #>
A non-Canadian somewhere.
<# @ENDIF #>

country is "Belgium"

Text before.
A non-Canadian somewhere.

More information

The examples spread the content and the commands on multiple lines to make it easier to read. This is not required.

The @ELSEIF action also interacts with @IF@ELSE@ENDIF. The order of the actions is:

  • @IF (Required)
  • @ELSEIF (Optional), can be used multiple times.
  • @ELSE (Optional), can only be there once
  • @ENDIF (Required)

A more in-depth explanation for using @IF (and @ELSE) is available in the explanations: Clarifying @IF.

See also