layout - 更改 header.links 上的 'Create an Account' 文本?

标签 layout magento2

想将“创建帐户”文本更改为“注册”,文本前带有图像标签,但我无法通过 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/

相关文章:

html - 绝对垂直、水平 float 的 div 元素

android - 横向模式下的自动完成 TextView - 下拉菜单上的键盘

php - 如何正确清理用户输出

import - Magento 2分组产品导入

magento - 为特定产品启用支付网关 - Magento 2

attributes - 我如何从 magento 2 的属性值中获取属性标签?

php - 无法保存库存项目。请再试一次。 Magento 2.4.0

objective-c - 尝试将 UIImageView 设置为背景 - 布局菜单项在哪里

magento2 - 错误 : DDL statements are not allowed in transactions while running setup:upgrade. 运行数据补丁

c - Windows 和 Linux 操作系统的内存布局有什么不同吗?