In Content fragment model, is there a way to display a list of fields on checkbox condition? | Community
Skip to main content
April 2, 2025
Solved

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

  • April 2, 2025
  • 2 replies
  • 355 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kapil_rajoria

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

2 replies

kapil_rajoria
Community Advisor
kapil_rajoriaCommunity AdvisorAccepted solution
Community Advisor
April 3, 2025

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

muskaanchandwani
Adobe Employee
Adobe Employee
April 8, 2025

@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.