BAJI26 Posted October 20, 2015 Share Posted October 20, 2015 See the attached! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 20, 2015 Share Posted October 20, 2015 use the following hook... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Categories'))) { $secondarySidebar->removeChild('Categories'); } }); 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 21, 2015 Author Share Posted October 21, 2015 Is it suppose to have both side bars there? See the button when you click it it will expand to duplicate the side bar that the arrow is pointed to! 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 27, 2015 Author Share Posted October 27, 2015 (edited) How to remove the duplicated side menu in the above image? Edited October 27, 2015 by BAJI26 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 27, 2015 Share Posted October 27, 2015 a hook should get rid of it - but is it being caused by a template conflict ? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 27, 2015 Author Share Posted October 27, 2015 I would need steps on how to remove it! Which tpl would it reside? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 27, 2015 Share Posted October 27, 2015 the above hook should get rid of it. if you're saying that there is a duplicate and the hook is only removing one of the sidebars, then it sounds similar to the issue in the thread below... http://forum.whmcs.com/showthread.php?106562-Double-Side-Menu-during-cart-process which was caused by using a site template designed for v6, with v6.1 order-form templates - and a conflict between the two. if that's what you're seeing, then updating to main theme template to v6.1.1 should solve it... e.g if you don't see the issue with the "Six" theme, but do with your custom theme, then your custom theme needs updating. if you want to edit templates, you could try the thread below... http://forum.whmcs.com/showthread.php?106435-how-to-remove-the-left-column-in-some-page-whmcs-6-1 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 27, 2015 Author Share Posted October 27, 2015 Yea! I updated all the files in six but the header and footer tpl... don't think that would cause it but dunno! - - - Updated - - - I think its the header/footer lol! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 27, 2015 Share Posted October 27, 2015 (edited) it's probably in both! Edited October 27, 2015 by brian! 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 27, 2015 Author Share Posted October 27, 2015 (edited) Both header and footer has the new sidebar code: In header.tpl change: {if $primarySidebar->hasChildren() || $secondarySidebar->hasChildren()} To: {if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())} And <div class="{if $primarySidebar->hasChildren() || $secondarySidebar->hasChildren()}col-md-9 pull-md-right{else}col-xs-12{/if} main-content"> To: <div class="{if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())}col-md-9 pull-md-right{else}col-xs-12{/if} main-content"> In footer.tpl Replace: {if $secondarySidebar->hasChildren()} With: {if !$inShoppingCart && $secondarySidebar->hasChildren()} Edited October 27, 2015 by BAJI26 0 Quote Link to comment Share on other sites More sharing options...
mustardman Posted October 27, 2015 Share Posted October 27, 2015 (edited) Both header and footer has the new sidebar code: In header.tpl change: {if $primarySidebar->hasChildren() || $secondarySidebar->hasChildren()} To: {if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())} And <div class="{if $primarySidebar->hasChildren() || $secondarySidebar->hasChildren()}col-md-9 pull-md-right{else}col-xs-12{/if} main-content"> To: <div class="{if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())}col-md-9 pull-md-right{else}col-xs-12{/if} main-content"> In footer.tpl Replace: {if $secondarySidebar->hasChildren()} With: {if !$inShoppingCart && $secondarySidebar->hasChildren()} I think doing it like this in the tpl files is a better more flexible and less error prone way compared to hooks unless you are sure you want to do it globally for all situations and all templates. This is how we remove the sidebar from certain pages and dependent on whether the client is logged in or not. Unless someone can show me a relatively easy way to do it with hooks that target specific pages and templates and dependent on whether the client is logged in or not then I will continue to believe that the Smarty way in tpl files is the best way. Edited October 27, 2015 by mustardman 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 27, 2015 Share Posted October 27, 2015 (edited) Unless someone can show me a relatively easy way to do it with hooks that target specific pages and templates and dependent on whether the client is logged in or not then I will continue to believe that the Smarty way in tpl files is the best way. there are a number of examples posted by sentq and myself that specify changes to occur only on certain pages and whether the client is logged in or not... the advantage of hooks is that once added, they should continue to work during WHMCS updates... if you modify the templates, you'll need to manually check for template changes during updates.. but there's no right or wrong way - it's whichever you feel most comfortable using, and more importantly, which one works for your needs. Edited October 27, 2015 by brian! 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 27, 2015 Author Share Posted October 27, 2015 This solution just fixes the duplicate problem I had. It doesn't do anything additional or extra to WHMCS! You can add conditions in your tpl files of you want. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 28, 2015 Share Posted October 28, 2015 as brian said, if you need to implement something or have any kind of issues with customization etc, there will be way or more to fix/implement it, you decide what is better for your needs after all. Hooks is more stable, i know people doing a lot of customization in their templates, then the update time is come and all the headache started, as what happened to the OP here. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted October 28, 2015 Author Share Posted October 28, 2015 I don't know how to use hooks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.