Skip to content

Instantly share code, notes, and snippets.

@zukucker
Created October 5, 2020 05:24
Show Gist options
  • Save zukucker/399550731a273a211c08b6a3e958673b to your computer and use it in GitHub Desktop.
Save zukucker/399550731a273a211c08b6a3e958673b to your computer and use it in GitHub Desktop.
hide blog categories in sidebar
{extends file="parent:frontend/index/sidebar-categories.tpl"}
{* Maincategories left *}
{function name=categories level=0}
<ul class="sidebar--navigation categories--navigation navigation--list{if !$level} is--drop-down{/if} is--level{$level}{if $level > 1} navigation--level-high{/if} is--rounded" role="menu">
{block name="frontend_index_categories_left_before"}{/block}
{foreach $categories as $category}
{block name="frontend_index_categories_left_entry"}
<li class="navigation--entry{if $category.flag} is--active{/if}{if $category.subcategories} has--sub-categories{/if}{if $category.childrenCount} has--sub-children{/if}" role="menuitem" style="{if $category.blog}display:none;{/if}">
<a class="navigation--link{if $category.flag} is--active{/if}{if $category.subcategories} has--sub-categories{/if}{if $category.childrenCount} link--go-forward{/if}"
href="{$category.link}"
data-categoryId="{$category.id}"
data-fetchUrl="{url module=widgets controller=listing action=getCategory categoryId={$category.id}}"
title="{$category.description|escape}"
{if $category.external && $category.externalTarget}target="{$category.externalTarget}"{/if}>
{$category.description}
{if $category.childrenCount}
<span class="is--icon-right">
<i class="icon--arrow-right"></i>
</span>
{/if}
</a>
{block name="frontend_index_categories_left_entry_subcategories"}
{if $category.subcategories}
{call name=categories categories=$category.subcategories level=$level+1}
{/if}
{/block}
</li>
{/block}
{/foreach}
{block name="frontend_index_categories_left_after"}{/block}
</ul>
{/function}
@zukucker
Copy link
Author

zukucker commented Oct 5, 2020

if the categorie has the blog flag active it will disappear in the sidebar menu - tested in shopware 5, responsive standard theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment