Changed on:
4 July 2024
Optionally render descendants only if certain criteria are met. This can be used to show different components depending on the results of the page query, for example:
Plugin Name | Core |
---|
The standard library of mystique components.
Initial changelog entry.
fc.conditional
n/a
Name | Type | Required | Default | Description |
value |
| yes | n/a | Template string to compare against the match value |
matches |
| yes | n/a | Value or list of strings to compare the value against |
1{
2 "component": "fc.conditional",
3 "props": {
4 "value": "{{order.type}}",
5 "matches": "HD"
6 },
7 "descendants": [ /* content to display if the order is home delivery */ ]
8}
9
10
11// on the same page, we can use a second conditional for click and collect orders. Only the one that matches will be rendered.
12
13
14{
15 "component": "fc.conditional",
16 "props": {
17 "value": "{{order.type}}",
18 "matches": "CC"
19 },
20 "descendants": [ /* content to display if the order is home delivery */ ]
21}
Language: json
First release
None
Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.