我想知道要在magento 2标头中为CMS页添加自定义顶部链接。

我知道如何在magento 1.x中添加自定义顶部链接。我应该在magento 2中做什么?

最佳答案

转到应用程序/设计/前端/Magento/YOUR_THEME\Magento_Theme\layout\default.xml

尝试这种方式,并用您的标识符和链接标题替换它:

<referenceBlock name="top.links">
<block class="Magento\Framework\View\Element\Html\Link\Current" name="contact-us">
<arguments>
<argument name="label" xsi:type="string">Contact Us</argument>
<argument name="path" xsi:type="string">contact-us</argument>
</arguments>
</block>
</referenceBlock>

关于php - 如何在magento 2中添加自定义顶部链接?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32632230/

10-10 14:10
查看更多