on 2019 Mar 26 5:22 PM
Hi,
I've extended the ContentPage to add another attribute like this:
<itemtype code="ContentPage" autocreate="false" generate="false">
<attributes>
<attribute type="java.lang.Boolean" qualifier="myBoolean">
<defaultvalue>Boolean.TRUE</defaultvalue>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
Now I want this flag to already be checked when I create a new content page in smartedit, but for me its always set to false. Does anyone know how to do this?
Thanks in advance
Request clarification before answering.
Ok, i found it out myself.
For everybody searching:
The approach by the original poster works for the backoffice and would have been enough in pre-headless times.
For smartedit additional adjustments are necessary to make the change visible there too:
In the case of a default value for a boolean attribute, smartedit is already prepared to handle it.
SeBooleanComponent.d.ts:
* @description
* Component responsible for generating custom toggle for the {@link genericEditorModule.service:GenericEditor genericEditor}.
*
* The following is an example of a possible field structures that can be returned by the Structure API for seBoolean to work:
* {
* cmsStructureType: "Boolean",
* qualifier: "someQualifier",
* i18nKey: 'i18nkeyForSomeQualifier',
* localized: false,
* defaultValue: true
* }
This means smartedit can already handle a boolean attribute „defaultValue“ with the values true / false.
To make this happen on the backend side
To have a better idea, check out this video which describes a similar scenario: https://enable.cx.sap.com/media/Customizing+an+Attribute+Editor+in+SmartEdit+-+SAP+Commerce+Cloud/1_...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.