ande85 Posted July 21, 2011 Share Posted July 21, 2011 Hi,We want to add subcategories to our webshop and present them in the categoryblock. We want the subcategory to be presented att the same li level as the main category but we want it to use another css class. How can this be done?The code in category-tree-bransch.tpl look like this:{$node.name|escape:html:'UTF-8'} {if $node.children|@count > 0} {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child last='false'} {/if} {/foreach} {/if}Hope you understand what i want to do and thanks for your answer if you have any suggestions on how this can be done. Link to comment Share on other sites More sharing options...
vivek tripathi Posted August 3, 2011 Share Posted August 3, 2011 Replace module->blockcategory->category-tree-branch.tpl code with this new one here is two class associated with the li either last or last-vivek through which you can differentiate you custom css <li {if isset($last) && $last == 'true'}class="last-vivek"{else}class="last"{/if}> <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> {if $node.children|@count > 0} {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child parr=$node.name last='true'} {else} {include file="$branche_tpl_path" node=$child parr=$child.name last='false'} {/if} {/foreach} {/if} </li> 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