【问题标题】:Add custom items and logo to Magento 2 Mobile Menu将自定义项目和徽标添加到 Magento 2 移动菜单
【发布时间】:2017-01-03 07:48:14
【问题描述】:

有没有人能够做到这一点?我正在寻找添加不显示在桌面站点中的自定义菜单项。

我画了一个模型,以便进行说明。任何建议表示赞赏!

Mockup

【问题讨论】:

  • 你解决了吗?
  • @themanwhoknowstheman 在下面查看我的答案!

标签: html css mobile magento2


【解决方案1】:

您可以添加到位于vendor/magento/module-theme/view/frontend/layout/default.xml 中第 65 行的父块。

将以下文件添加到您的主题中。

app/design/frontend/VENDOR/THEME/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">                
    <body>                    
        <referenceBlock name="store.menu">
            <block class="Magento\Framework\View\Element\Template" name="store.menu.logo" template="Magento_Theme::html/mobile_menu_logo.phtml" after="catalog.topnav" />                    
        </referenceBlock>
    </body>        
</page>

app/design/frontend/VENDOR/THEME/Magento_Theme/templates/html/mobile_menu_logo.phtml

<!-- content goes here -->

【讨论】:

    猜你喜欢
    • 2012-09-05
    • 2012-10-24
    • 1970-01-01
    • 2017-07-08
    • 1970-01-01
    • 2018-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多