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

Classification attributes in backoffice minimized

former_member633554
Active Participant
0 Likes
714

How do you make it so classification attributes in backoffice are minimized when you first go to the page. By default they are all visible. On products with many classification attributes this can be cumbersome to scroll through.

This is hybris version 6.7

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Leo,

The easiest part of the task is to add configuration like this one below in the backoffice-config.xml

<context type="Product" component="editor-area" merge-by="type">
        <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
        .....
		<editorArea:tab name="hmc.tab.product.properties" merge-mode="append" position="1">
		<editorArea:customSection name="hmc.properties.classattributes" initiallyOpened="false"
                       spring-bean="customPropertiesSectionRenderer"/>
		.....								  
		</editorArea:tab>
		.....
</editorArea:editorArea>
</context>	

The attribute that you actually need is initiallyOpened="false"

Unfortunately this is not all. In addition you need to create custom spring-bean. Something like customPropertiesSectionRenderer that extends DefaultEditorAreaSectionRenderer

In this custom renderer you need to override render method and add the following implementation based on the requirements on your project.

Button expandButton = new Button();
            expandButton.setSclass("yw-expandCollapse");
            expandButton.addEventListener("onClick", e ->
                sectionGroupBox.setOpen(!sectionGroupBox.isOpen())
            );

Probably you will also need to rework a little bit Groupbox section. But more or less that's all.

Hope this helps.

Best Regards,

Answers (0)