首页 > 解决方案 > 使用插件 Shopware 在菜单中自定义项目

问题描述

请告诉我如何使用插件在前端添加菜单项?我沿着路径视图/前端/索引/main-navigation.tpl添加了一个带有新菜单项的模板。但是菜单项只出现在插件创建的页面上,而不是整个站点上。

标签: shopware

解决方案


这是主菜单所在的位置:

├── frontend
 │   └── index
 │      └── shop-navigation.tpl

您可以覆盖其内容或只是附加到它。以下是文件内容的外观:

{extends file="parent:frontend/index/shop-navigation.tpl"}

{block name='frontend_index_checkout_actions'}
<li class="navigation--entry">
    <a href="" class="btn starButton"> {* Add an URL to the href attribute to make your link work *}
        <i class="icon--star"></i>
    </a>
</li>

{$smarty.block.parent}
{/block}

推荐阅读