如何在 Magento 2.3.* 中启用自定义系统配置?
How to enable custom system configuration in Magento 2.3.*?
我目前正在做一个 Magento 项目,我必须在其中添加自定义系统配置来管理我的主机。
我遵循了我在使用 Magento 2.2 版的旧项目中使用的旧配置。
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="catalog" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="config" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Setup</label>
<field id="host" translate="label" type="text" sortOrder="67" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Host</label>
</field>
</group>
</section>
</system>
</config>
但从 Magento 2.3 开始,此解决方案不再有效。
我是否必须手动启用配置才能在管理配置面板中看到它?
在该部分中,您缺少以下节点:
<section ...>
<tab>$TAB</tab>
<label>$LABEL</label>
<resource>$RESOURCE</resource>
</section>
我试过你的代码片段,对我来说效果很好。
也许 Catalog Tab
(蓝色下划线)和 'Catalog Section'(黄色突出显示)之间存在混淆?
如果是,请告诉我,我会为您提供所需的代码段。