Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

In Content fragment model, is there a way to display a list of fields on checkbox condition?

Avatar

Level 1

I am creating Content Fragment model for a react component and there is requirement to show a set of fields if a checkbox is true for the content authors. Is that possible to implement?

For example, if the author checks "show message on expiry" it should display a text field to get message as input. Otherwise the message field should be hidden.

2 Replies

Avatar

Community Advisor

Hi @phaiza,
For this you can create a new custom data type which is a merge of checkbox and textfield. Try writing a custom javascript for the same.
Thanks

Avatar

Employee

@phaiza If the requirement is strictly for the front-end display, you can handle the logic in your React component. The Content Fragment can expose all fields, and the React component can determine which fields to display based on the checkbox's value.