twig tutorial - Conditional blocks in Twig - twig block - twig if - twig php - twig template
Conditional blocks
- Parts of template can be displayed conditionally. If statement is used for this purpose. It's similar to if statement in programing languages. Contents of block are executed/displayed if an expression evaluates to true
- Disabled will be displayed only when enabled will be equal false.
Multiple branches can be created using elseif and else.