– “tab” node create a new tab. The attribute “sortOrder” allow you to change it’s position on the list. You can try from yourself and check on Magento core files the values for the native configuration nodes.
– “section” node add a new element to our tab. We associate it with the “tab” node. You can change the text with the label value. Finally, the resource define the right to show the element.
– “group” node create a group of field on the form. We have only one group at this moment with the lebel “Department Configuration”.
– To finish, we have our “field”. We set the “select” type, and define the label and the comment. The “source_model” allow you to retrieve the array of values for the select. We use a native object from Magento which return a “Yes/No” array.

You can add some section / group / field in Magento native tabs / sections / groups. For example, you can add a new group with some new field inside the “Catalog” tab and “Catalog” section.

Manage config scope

You notice the attributes : showInDefault, showInWebsite, showInStore
We define the element’s scope.

A Magento store has got website, store and store view :

We will learn the behaviour later on this training. You only have to know that a Magento store can have many websites, with many stores, with many store views.

We have only one store view, but our field must be customizable on each store view, so these 3 attributes are set with “1” value.

Magento will retrieve the config value like this :
– If the field has got store view scope (showInStore), and a value is defined, we return it
– Else if the field has got website scope (showInWebsite), and a value is defined, we return it
– Else we return the default scope value (showInDefault)

It’s an example of the configuration creation. You can change it if you want, and have fields only with the store view scope !

When you edit configuration on Magento admin, you can change the current scope with this menu :

During this lesson, we stay with “Default Scope”.
Now, refresh the admin stores configuration page and our menu… is not displayed !

ACL creation

It is not displayed because we haven’t created the access (ACL) to show it.

One thought on “Configuration creation on Magento 2 admin”

I am developing an extension where in the ADMIN store>>configuration my extension setting i want to put attribute draggable and sortable list and therefore i need to set custom template for this particular field, so is there any way i can put custom template phtml file inside system.xml?