【发布时间】:2019-12-16 04:38:00
【问题描述】:
- 安装了 clear magento 2.3.2
- 创建了简单的自定义主题,其中包含(
theme.xml、registration.php和CustomTheme/Magento_Customer/layout/customer_account_create.xml)。 - 我还创建了一个简单的扩展程序,它向客户帐户创建表单添加了一个自定义字段(此扩展程序也使用
customer_account_create.xml)。
<body>
<referenceContainer name="form.additional.info">
<block class="CompanyName\ModuleName\Block\Test" name="test"
template="CompanyName_ModuleName::form/test.phtml"/>
</referenceContainer>
</body>
在那之后我得到了奇怪的行为:
如果我的CustomTheme/Magento_Customer/layout/customer_account_create.xml 就像来自核心的原始文件一样,则将非标准字段添加到表单中,而我的自定义扩展名没有问题。
但是如果我要修改我的文件CustomTheme/Magento_Customer/layout/customer_account_create.xml(例如我刚刚添加了这个字符串来删除迷你车:`)。
我的非标准字段不适用于表单
一切看起来好像我在自定义主题中修改布局以满足我的需要(从注册页面中删除一些元素),然后使用此布局或引用此布局的所有其他自定义扩展将停止工作。
【问题讨论】: