---
title: "Using else and else-if conditions"
description: "Use else and else-if conditions in templates to display different content based on varying data values. It covers how to provide alternative or fallback text when initial conditions are not met."
canonical_url: "https://resources.docmosis.com/template-tutorials/else-and-else-if"
last_reviewed: 2026-06-08
---

# Using else and else-if conditions

Within a Conditional Section it is possible to include an Else statement to allow alternative content to be provided in case where an expression is false.

Else\-If style statements provide an alternative expression to be evaluated to conditionally include other content.

### Else statements

These may be used once within a \<\\>option 1\<\\>option 2\<\\> is like saying:

IF trees\= "true" THEN

display all text from \<\\> up to \<\\>

OTHERWISE

display all text from \<\\> up to \<\\>

The data would have: "trees":"true" to display option 1, and "trees":"false", or simply omit "trees", to display option 2 (JSON example).

### Else\-If statements

An Else statement may also contain an expression making it an Else\-If statement.

This allows an alternative condition to be tested if the first condition is not true.

If neither the \<\8} will be evaluated.

If "true" then all following text up to the next \<\3} will be evaluated.

If this expression is "true" then all the following text up to the next \<\\>

 There are trees in the area.

\<\\>

 There are no trees in the area.

\<\\>

**ELSE\-IF**

\<\\>

 Today’s topping is chocolate.

\<\\>



 Today’s topping is fudge.

\<\\>

**ELSE\-IF and ELSE**

\<\8}\>\>

 The school band has more than eight instruments

\<\3}\>\>

 The school band has more than three but less than eight instruments.

\<\\>

 The school band has three or less instruments.

\<\\>
```