In the previous article we described how to create your own section on the Magento 2 configuration page (Stores > Configuration).

In order to set the default values for the configuration fields, you need to create the following file in the module folder:


and add this code:

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">

The section_id/group_id/field_id hierarchy has to match the structure in the system.xml file.

To clear the cache, run the CLI command:

php bin/magento cache:clean

Check the result.

In the examples, we create a module for FAQ. The modified module code can be viewed on GitHub.