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
(例如,我只是添加了这个字符串来删除minicart:`)。我的非标准字段不适用于表单。
一切看起来好像我修改了自定义主题中的需要的布局(从注册页面中删除一些元素),那么使用这个布局或引用这个布局的所有其他自定义扩展都将停止工作。
发布于 2019-08-27 14:45:53
https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-override.html
我认为,在进行任何大的修改之前,您需要多读一些关于开发您自己的定制主题的概念和过程,最终您将有一个非常糟糕的结果,并且无法持续的代码。
发布于 2019-08-29 01:20:12
https://stackoverflow.com/questions/57413073
复制相似问题