3

We used to have the expanded element in the group options when setting the system.xml file, e.g.

<sections>
 <groups>
 <groupx>
 <expanded>1</expanded>

but it's no longer there in the new structure in Magento 2, I checked system_file.xsd and couldn't find it. Is there an alternative in Magento 2 to have all the groups expanded by default.

asked May 27, 2017 at 22:04

1 Answer 1

9

You can use <attribute type="expanded">1</attribute>

Ex:

<section id="helloworld" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
 <label>Hello World</label>
 <tab>helloworld</tab>
 <resource>Amit_Helloworld::hello_configuration</resource>
 <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
 <label>General Configuration</label>
 <attribute type="expanded">1</attribute>
 <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
 <label>Module Enable</label>
 <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
 </field>
 <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
 <label>Display Text</label>
 <comment>This text will display on the frontend.</comment>
 </field>
 </group>
</section>
answered May 28, 2017 at 16:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.