From 709eadd664b6e8753fd1102d35864031652b7bee Mon Sep 17 00:00:00 2001 From: Yuri Salimovskiy Date: Tue, 18 Apr 2023 14:56:25 +0300 Subject: [PATCH 1/2] added additional info on when braces are required in conditionals --- docs/templates/conditionals.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/templates/conditionals.md b/docs/templates/conditionals.md index 526fc5f4d..d061aae50 100755 --- a/docs/templates/conditionals.md +++ b/docs/templates/conditionals.md @@ -281,6 +281,21 @@ Tags that output numeric content will work fine with quotes, but also do not nee {if {fluid_content:count type="long_form_text"} == 3} +If the conditional expression contains [variable modifiers](templates/variable-modifiers.md), braces should only be omited if the conditional is executed on top-level variable (not Grid column or Fluid field element) and there is only one check in the expression (no AND / OR operators). +In other words, you can only do following without braces: + + {if grid_field:total_rows} + +But you will need braces in there cases: + + {if {grid_field:total_rows} AND {another_grid_field:total_rows}} + + {if {grid_field:text_column:length}} + + {fluid:rte_field} + {if '{content:has_excerpt}' == 'y'}

Read More

{/if} + {/fluid:rte_field} + ## Short Conditionals Certain conditionals exist in a shortened form in order to improve template readability. These conditionals are usually checking to see if a certain thing is true or exists: From e0e5768e24c9ea7ac743be4e64667ef6b97442c4 Mon Sep 17 00:00:00 2001 From: Tom Jaeger Date: Tue, 2 May 2023 12:30:53 -0400 Subject: [PATCH 2/2] Update conditionals.md --- docs/templates/conditionals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/templates/conditionals.md b/docs/templates/conditionals.md index d061aae50..bc3511af3 100755 --- a/docs/templates/conditionals.md +++ b/docs/templates/conditionals.md @@ -281,7 +281,7 @@ Tags that output numeric content will work fine with quotes, but also do not nee {if {fluid_content:count type="long_form_text"} == 3} -If the conditional expression contains [variable modifiers](templates/variable-modifiers.md), braces should only be omited if the conditional is executed on top-level variable (not Grid column or Fluid field element) and there is only one check in the expression (no AND / OR operators). +If the conditional expression contains [variable modifiers](templates/variable-modifiers.md), braces should only be omited if the conditional is executed on a top-level variable (not Grid column or Fluid field element) and when there is only one check in the expression (no AND / OR operators). In other words, you can only do following without braces: {if grid_field:total_rows}