RevTree
#43

Basic 'if' statements

Data and Logic · Working

What is this skill?

Basic 'if' statements in Nunjucks allow you to show or hide content based on conditions, such as whether a user has entered certain data or selected a specific option.

Why is it important?

  • Dynamic content – Show different content based on user input
  • Conditional visibility – Hide sections that aren't relevant to the user
  • Error handling – Display error messages only when validation fails
  • Personalisation – Tailor the experience based on previous answers

Where to learn more