This sfpegConditionalContainerCmp container component provides up to 1' conditionally displayed sections (plus one optional default fallback one) in which other components may be added, leveraging criteria on field values usually on the page record or current User.
Multiple sections may be displayed if multiple criteria are met by the field value fetched. Two criteria evaluation strategies are available:
- for a multi-picklist field, each section should have an individual value criteria and the section is then displayed if the multi-picklist field value contains this value.
- for a standard picklist (or even text) field, each section should have a sequence of possible values separated by spaces and the section is then displayed if the picklist field value is one of them.
ℹ️ There is no constraint on the criteria values and a same value may appear multiple times in the different criteria (for the standard picklist evaluation strategy)
All the configuration is achieved from Site Builder, the following properties being available:
Force Complete Display?
to force the display of all sections (for Site Builder configuration to define/display the components for all cases)Source Field
to define the API Name of the field used to evaluate display conditionsMulti-Value Source Field?
to indicate that the sourceField is a multi-value (i.e. not a standard picklist field) and apply the corresponding criteria evaluation strategy (see above)Condition #1
toCondition #14
to define the reference value(s) for criteria evaluation for the corresponding section. This may be a list of values separated by blanks in the standard picklist evaluation strategy or a single value in the multi-picklist oneHandle Default?
to activate default section when no prior condition is met. When set to false, no section is displayed if no criteria is metWrapping CSS
to specify CSS classes on each section divShow Debug?
to activate debug informationObject API Name
to provide the API Name of the Object used to fetch theSource Field
value (usually current page object but may also be User)Record ID
to provide the ID of the record used to fetch theSource Field
value (usually current page record ID but may also be current user ID)
When displayed in Site Builder (even in preview mode),
- information boxes are systematically displayed in stripped shaded SLDS theme to tell the user about the location of the Conditional Container (Multi-Value) component and its conditions.
- up to 15 drop sections are proposed to add and configure the components to display when any of the 14 conditions or the default fallback one is met.
These elements do not appear in the published LWR external site.
This component supports two layout slots as for LWR Layout Components to define and configure the components respectively for the different criterias cases.
- The invalid case section is displayed if and only if the
Show Default?
property is set totrue
(and if the condition is not met). - By setting the
Force Complete Display?
property totrue
, it is possible to systematically display all sections and the default section ifShow Default?
is true, which may be helpful to get a holistic view of the components configured.
Force Complete Display?
before publishing the site!
Please refer to data binding expressions such as {!Item.contentBody.body}
for details about how to configure the current value.