cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Nested components attribute "visible" set to false by default on Smart Edit

Former Member
0 Likes
1,080

Hi,

We have some components that make use of other components (nested components). The issue we are facing is that, when creating the nested component from Smart Edit, the attribute "Display Component" is set to false by default. Is there any way to change this behaviour?

We are using hybris 6.6.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi, for the nested components, the configuration to create the component is set in nestedComponentManagementService. so you can override the prepareComponentData data method in the service and append the content object with an additional property i.e., visible: true. This way any time you create a nested component, visibility is set to true by default.

The new method would look like:

 var prepareComponentData = function(componentInfo, editorStackId) {
             var type = componentInfo.componentType.toLowerCase();
             return {
                 componentUuid: componentInfo.componentUuid,
                 componentType: componentInfo.componentType,
                 title: 'type.' + type + '.name',
                 content: lodash.defaultsDeep({}, {
                     typeCode: componentInfo.componentType,
                     itemtype: componentInfo.componentType,
                     visible: true
                 }, componentInfo.content),
                 editorStackId: editorStackId
             };
         };
Former Member
0 Likes

Great, thanks! Just tried it and works perfectly

Answers (3)

Answers (3)

former_member687905
Discoverer
0 Likes
0 Likes

Is there a step by step guide to follow for this ?

Thanks for your help in advance !!

0 Likes

Is there a step by step guide to follow for this ?

Thanks for your help in advance !!