From 8b6ff81f00a4c202ade4271801ad6efa075c26a1 Mon Sep 17 00:00:00 2001 From: lich17 <47055578+lich17@users.noreply.github.com> Date: Sat, 15 Mar 2025 15:09:56 +0300 Subject: [PATCH] Update control-flow-tags.md Add example and explanation for multiple values in case/when tags --- power-pages-docs/configure/liquid/control-flow-tags.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/power-pages-docs/configure/liquid/control-flow-tags.md b/power-pages-docs/configure/liquid/control-flow-tags.md index e439347c8..85c9bbeac 100644 --- a/power-pages-docs/configure/liquid/control-flow-tags.md +++ b/power-pages-docs/configure/liquid/control-flow-tags.md @@ -63,7 +63,8 @@ Hello, stranger. ## case/when -A switch statement to compare a variable to different values, and execute a different block of code for each value. +A switch statement to compare a variable to different values, and execute a different block of code for each value.
+A **when** tag can accept multiple values. When multiple values are provided, the expression is returned when the variable matches any of the values inside of the tag. Provide the values as a comma-separated list, or separate them using an or operator. ``` {% case user.fullname %} @@ -76,6 +77,10 @@ Hello, Dave. Hello, Mr. Smith. +{% when 'Alice Johnson' or 'Bob Johnson' %} + +Hello, Johnson family member. + {% else %} Hello, stranger.