想将“创建帐户”文本更改为“注册”,文本前带有图像标签,但我无法通过 Magento_Customer/layout/default.xml 的以下修改来更新文本。
<referenceBlock name="register-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">Register</argument>
</arguments>
</referenceBlock>
<referenceBlock name="my-account-link" display="false" />
<!--
<move element="register-link" destination="header.links"/>
<move element="header" destination="header.links" before="-"/>
<move element="top.links" destination="customer"/>
<move element="authorization-link" destination="top.links" after="-"/>
-->
<block
class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link"
template="account/link/authorization.phtml" before="register-link"/>
</referenceBlock>
<block class="Magento\Theme\Block\Html\Header" name="header" as="header">
<!--
<arguments>
<argument name="show_part" xsi:type="string">welcome</argument>
</arguments>
-->
</block>
我的错是什么?
最佳答案
<referenceBlock name="register-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">Register</argument></arguments>
</referenceBlock>
将上面的代码放在
/app/design/frontend/vendor/module/Magento_Theme/layout/default.xml
刷新 Magento 缓存...
关于layout - 更改 header.links 上的 'Create an Account' 文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37741617/