In Content fragment model, is there a way to display a list of fields on checkbox condition? | Adobe Higher Education
Skip to main content
April 2, 2025
해결됨

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

  • April 2, 2025
  • 2 답변들
  • 355 조회

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.

이 주제는 답변이 닫혔습니다.
최고의 답변: 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 답변

kapil_rajoria
Community Advisor
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.