Conditional
The Conditional block shows or hides its child content based on a JsonLogic condition evaluated against the replacements context at render time. It supports a primaryelements branch (rendered when the condition is truthy) and an optional else_elements branch (rendered when falsy).
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
type | "conditional" | yes | — | Block type identifier |
condition | JsonLogicRule | yes | — | A JsonLogic rule object evaluated against the replacements context |
elements | BlockElement[] | yes | — | Blocks rendered when the condition evaluates to truthy |
else_elements | BlockElement[] | no | — | Blocks rendered when the condition evaluates to falsy. If omitted, nothing renders for the false case |
Basic Usage
isProctored is truthy. Renders nothing when falsy (no else_elements provided).
With Else Branch
Condition Expressions
Conditions use JsonLogic — a portable, JSON-based rule format. The replacements context is passed as the data argument.Variable Access
Read a value from replacements. Supports dot-notation for nested data.Comparisons
Logical Operators
Array Membership
Nested Conditionals
Inside a Repeater
Conditionals work inside repeaters with scoped item variables:Builder Integration
In the WYSIWYG builder:- Drag Conditional from the Layout category in the block library
- Configure the Condition as a JsonLogic expression in the properties panel
- Toggle between If True and If False views using the header buttons
- Add blocks to each branch — they render based on the condition result
- Use the Replacements panel to provide preview data, then switch to Preview mode
Nesting Rules
A conditional can appear in:- Root level
- Section
- Wizard Step
- Column
- Repeater
- Remote Block (fallback)
- Another Conditional (both branches)
- Heading, Text, Alert, Lists, Column Layout, Section, Actions, Form, Button, Block Replacement, Repeater, Remote Block, nested Conditional
User Facing Documentation
Conditional Content Blocks
Conditional blocks allow you to show different content to different users based on specific conditions. This is useful when you need to personalize the experience — for example, showing proctoring instructions only to students taking a proctored exam, or displaying different messages based on how many attempts a student has remaining. How it works:- A conditional block evaluates a condition against the data available on the page
- If the condition is true, the “If True” content is displayed
- If the condition is false, the “If False” content is displayed (if provided) — otherwise nothing is shown
- Conditions can check simple yes/no flags, compare numbers (e.g., “more than 3 attempts”), or combine multiple checks together
- Showing proctoring setup instructions only for proctored exams
- Displaying a warning when a student has exceeded their attempt limit
- Showing different messages based on a user’s role (admin vs. student)
- Hiding optional sections when data is not available
