2

Is there an official detailed documentation of the possible nodes,values and attributes than can be found in system.xml

I can figure out the meaning of some of them myself, but some of them elude me.

For example why do sections of groups have a type attribute, what else could they be other than text. Mind you that section and groups are not inputs.

What does the canRestore="1" attribute in fields mean?

Who is responsible for interpreting the system.xml information and transforming it into a form?

To get a feeling of what I'm looking please take a look at this documentation of the layout instructions Layout instructions docs

1 Answer 1

0

Welcome to the world of Magento development. A lot is not documented and basically you have to educate yourself with trial and error working towards an answer.

There is no public documentation.

https://github.com/magento/magento2/blob/0eb8677b0b4e35606032e856cc1ef7c80e68829f/app/code/Magento/Config/Model/Config/Structure/Element/Field.php#L295-L298

    /**
     * Check if the field can be restored to default
     *
     * @return bool
     * @since 100.1.0
     */
    public function canRestore()
    {
        return isset($this->_data['canRestore']) && (int)$this->_data['canRestore'];
    }

Which is not clear at all.

https://github.com/magento/magento2/blob/2bca2aa1a6c1828c379bb9c75db2810a92cd3d37/app/code/Magento/Config/Block/System/Config/Form.php#L380

'can_restore_to_default' => $this->isCanRestoreToDefault($field->canRestore()),

https://github.com/magento/magento2/search?q=can_restore_to_default&unscoped_q=can_restore_to_default

No results

https://github.com/magento/magento2/search?q=RestoreToDefault&unscoped_q=RestoreToDefault

More meaningful results

https://github.com/magento/magento2/blob/0eb8677b0b4e35606032e856cc1ef7c80e68829f/app/code/Magento/Backend/view/adminhtml/web/template/form/element/helper/fallback-reset-link.html

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<button class="action-tertiary"
        click="element.restoreToDefault">
    <span translate="'Use Default Value'"></span>
</button>

So it means these config options have the 'Use Default Value' option

1
  • Thx for that. I'll leave the question open maybe someone finds a detailed list. May 28, 2019 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.