Rockstar2 Posted June 16, 2010 Share Posted June 16, 2010 I would like a maximum number # of 5 categories to show on the sidebar and after the limit -- for the word "more" to show under each category section. How can I do this? Link to comment Share on other sites More sharing options...
Rockstar2 Posted June 27, 2010 Author Share Posted June 27, 2010 anyone know how? Link to comment Share on other sites More sharing options...
thisisit Posted June 27, 2010 Share Posted June 27, 2010 I believe you should update the code.However there is another way to limit the depth of the category. Go to back office, modules, Categories block, maximum depth Link to comment Share on other sites More sharing options...
Rockstar2 Posted June 28, 2010 Author Share Posted June 28, 2010 Mine is different. I want to show the 1st dept of subcats but want to limit them to show only 5 on the sidebar and to see the rest customer must click on "more" next to each category. Link to comment Share on other sites More sharing options...
Rockstar2 Posted July 3, 2010 Author Share Posted July 3, 2010 anyone know what code to update? Link to comment Share on other sites More sharing options...
rocky Posted July 4, 2010 Share Posted July 4, 2010 I suggest that you set the "Maximum depth" on the configuration page of the "Categories block" to 1 so that only the top-level categories are displayed, then change line 112 of modules/blockcategories/blockcategories.php from: ORDER BY `level_depth` ASC, cl.`name` ASC')) to: ORDER BY `level_depth` ASC, cl.`name` ASC LIMIT 0, 6')) This should display 5 categories only. You can then edit modules/blockcategories/blockcategories.tpl and add the following after line 15 (the ): getCategoryLink(1, 'home')}">{l s='More...' mod='blockcategoriesnc'} Link to comment Share on other sites More sharing options...
Timothy Jarman Posted March 10, 2012 Share Posted March 10, 2012 Hey Rocky, thank you very very much for your help. I have never coded before but as my blockcategories.php was different from above, here is how I got my clients shop to display only 4 main categories. blockcategories.php contained: ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'c.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC')) Changed to the following: ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'c.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC LIMIT 5')) If i have got this wrong, please let me know Thanks www.fantasy-costumes.co.uk Link to comment Share on other sites More sharing options...
cedgeonline Posted May 26, 2017 Share Posted May 26, 2017 Hi Rocky, The first line works: ORDER BY `level_depth` ASC, cl.`name` ASC LIMIT 0, 6')) But the second line seems to be not working, <p><a >getCategoryLink(1, 'home')}">{l s='More...' mod='blockcategoriesnc'}</a></p> Where will you put the line in our blockcategories.tpl? ================= {if $blockCategTree && $blockCategTree.children|@count} <!-- Block categories module --> <div id="categories_block_left" class="block"> <h2 class="title_block"> {if isset($currentCategory)} {$currentCategory->name|escape} {else} {l s='Categories' mod='blockcategories'} {/if} </h2> <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/foreach} </ul> </div> </div> <!-- /Block categories module --> {/if} ========================== 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