Closed ma-schmidt-de closed 1 month ago
Testing the no-code content model editor, I saw that my implementation acts as expected. The switch is rendered and a settings
object is added to the field's renderer.
Yet, saving the model the CmsUpdateContentModel
mutation fails due to the fact, that the default fields Title
, Description
and Image
don't have a settings
object attached to their field renderer. Is this a known issue? 🤔
When I create an empty content model and add an object, dynamic zone or arbitrary field it works just fine.
@ma-schmidt-de I pushed a fix for that issue with existing fields, so settings
will always fall back to {}
if they don't exist on the field.
@Pavel910 thanks for adding the fix! I polished the code style according to your feedback. This looks complete to me now. 👍
It's approved, let's wait for CI to finish, and we'll merge it then.
Thanks @ma-schmidt-de for your contribution! Looking forward to more of these!! 🚀
Changes
Okay, this is the 2nd iteration of the new feature to expand object and dynamic zone HCMS fields by default. According to @Pavel910's recommendation, I'm using the new renderer settings feature to define an
open
attribute. If this attribute is set totrue
, the accordion of the object or dynamic zone field is expanded.BREAKING CHANGE: none Closes: #4109
How Has This Been Tested?
Manually, with an in-code content model.
Documentation
We could use this implementation as an example for the section that describes the renderer settings feature.