DARKF3D3 Posted June 5, 2016 Share Posted June 5, 2016 (edited) There's a way to exclude selected subcategories from the category page? This is the code I'm using to show subcategories into the category page: {if isset($subcategories)} {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) } <!-- Subcategories --> <div id="subcategories"> <ul class="clearfix"> {foreach from=$subcategories item=subcategory} <li> <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'}</a></h5> {if $subcategory.description} <div class="cat_desc">{$subcategory.description}</div> {/if} </li> {/foreach} </ul> </div> {/if} {/if} Edited August 18, 2016 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted June 6, 2016 Share Posted June 6, 2016 you can try with an id, like {if $subcategory.id_category|in_array:[1,2,3]} do not display anything, otherwise display the normal content Link to comment Share on other sites More sharing options...
DARKF3D3 Posted June 17, 2016 Author Share Posted June 17, 2016 Thank you Nemo, I added the code you posted into the foreach loop and it worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now