David Duarte Posted June 11, 2018 Share Posted June 11, 2018 Dear friends, I've already tried to include the Support Secondary Sidebar on submitticket.php page, but I was not able. I can add a custom sidebar, but what I would like is to show the Support default secondary Sidebar. Any idea if this can be done and how? Thank you very much. Best regards, David Duarte 0 Quote Link to comment Share on other sites More sharing options...
David Duarte Posted June 11, 2018 Author Share Posted June 11, 2018 After all it seems the primary and secondary bar are included only if the customer has tickets. I would like to have the secondary bar even if he has no tickets. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 12, 2018 Share Posted June 12, 2018 Hi David, 17 hours ago, David Duarte said: I've already tried to include the Support Secondary Sidebar on submitticket.php page, but I was not able. I can add a custom sidebar, but what I would like is to show the Support default secondary Sidebar. unless you can do it using Contexts, the easier way might just be to make a custom sidebar - if you're taking about the sidebar below... the way I would suggest is to write a hook that checks, on the submittickets page, if that support sidebar exists and if so, does nothing...if it doesn't, then you recreate the support sidebar - it's only six links with icons, so there should be plenty of coding examples elsewhere in the community about how to do that... although, all those links will be available in the navbar by default (unless you've modified the navbar). 0 Quote Link to comment Share on other sites More sharing options...
David Duarte Posted June 19, 2018 Author Share Posted June 19, 2018 Hello Brian, Thank you very much for your help. With your tips I was able to code what I needed. Here you have the code, as it can be useful for someone else. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (APP::getCurrentFileName()=="submitticket"){ if (!is_null($secondarySidebar->getChild('Support'))) { }else{ $secondarySidebar->addChild('sidebar1', array( 'label' => Lang::trans('navsupport'), 'order' => '10', 'icon' => 'fa-support' )); $secondarySidebar->getChild('sidebar1') ->addChild('child1', array( 'label' => Lang::trans('clientareanavsupporttickets'), 'uri' => 'supporttickets.php' )); $secondarySidebar->getChild('sidebar1') ->addChild('child2', array( 'label' => Lang::trans('announcementstitle'), 'uri' => 'announcements' )); $secondarySidebar->getChild('sidebar1') ->addChild('child3', array( 'label' => Lang::trans('knowledgebasetitle'), 'uri' => 'knowledgebase' )); } } }); 1 Quote Link to comment Share on other sites More sharing options...
David Duarte Posted June 19, 2018 Author Share Posted June 19, 2018 Now with icons <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (APP::getCurrentFileName()=="submitticket"){ if (!is_null($secondarySidebar->getChild('Support'))) { }else{ $secondarySidebar->addChild('sidebar1', array( 'label' => Lang::trans('navsupport'), 'order' => '10', 'icon' => 'fa-support', )); $secondarySidebar->getChild('sidebar1') ->addChild('child1', array( 'label' => Lang::trans('clientareanavsupporttickets'), 'uri' => 'supporttickets.php', 'icon' => 'fa-ticket' )); $secondarySidebar->getChild('sidebar1') ->addChild('child2', array( 'label' => Lang::trans('announcementstitle'), 'uri' => 'announcements', 'icon' => 'fa-list' )); $secondarySidebar->getChild('sidebar1') ->addChild('child3', array( 'label' => Lang::trans('knowledgebasetitle'), 'uri' => 'knowledgebase', 'icon' => 'fa-info-circle' )); } } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 20, 2018 Share Posted June 20, 2018 for the benefit of others, it's worth noting that the only reason the sidebar children are in the desired order is because David has called them child1, child2 etc... if he had given them the names used by default in WHMCS, he would have needed to add 'order' values to each of the children to specify their sidebar position, otherwise they would have been shown in alphabetical order by their child names. 0 Quote Link to comment Share on other sites More sharing options...
BackupAddict Posted December 13, 2020 Share Posted December 13, 2020 Hey guys, this works good, but it's also on the log in page. How can I remove it from certain pages? Use it on 8.1RC 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 14, 2020 Share Posted December 14, 2020 14 hours ago, BackupAddict said: How can I remove it from certain pages? Use it on 8.1RC does it really do that? i'm not seeing that occurring on v8.1b1 with Six or 21 - will have to update the dev to check... 0 Quote Link to comment Share on other sites More sharing options...
BackupAddict Posted December 14, 2020 Share Posted December 14, 2020 7 hours ago, brian! said: does it really do that? i'm not seeing that occurring on v8.1b1 with Six or 21 - will have to update the dev to check... Hello, yep, even the home page. I am using a Zomex template tho, might that be the cause? Running on 8.1RC 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 15, 2020 Share Posted December 15, 2020 16 hours ago, BackupAddict said: Hello, yep, even the home page. I am using a Zomex template tho, might that be the cause? Running on 8.1RC this is what i'm seeing on a v8.1RC1 dev using the Zomex (Stellar) template... that sidebar is only included on the submitticket page (using either of David's hooks above) - it's not showing on any other page for me... including login. I suppose, if for some reason, it doesn't like the use of APP, then there would be alternative ways of getting the filename.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { GLOBAL $smarty; $filename = $smarty->getTemplateVars()['filename']; if ($filename == "submitticket" && is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->addChild('sidebar1', array('label' => Lang::trans('navsupport'), 'order' => '10', 'icon' => 'fa-support',)); $secondarySidebar->getChild('sidebar1')->addChild('child1', array('label' => Lang::trans('clientareanavsupporttickets'), 'uri' => 'supporttickets.php', 'icon' => 'fa-ticket')); $secondarySidebar->getChild('sidebar1')->addChild('child2', array('label' => Lang::trans('announcementstitle'), 'uri' => 'announcements', 'icon' => 'fa-list')); $secondarySidebar->getChild('sidebar1')->addChild('child3', array('label' => Lang::trans('knowledgebasetitle'), 'uri' => 'knowledgebase', 'icon' => 'fa-info-circle')); } }); which again for me only shows the sidebar on the submitticket page and nowhere else... 0 Quote Link to comment Share on other sites More sharing options...
BackupAddict Posted December 15, 2020 Share Posted December 15, 2020 yup, I see that on the Fusion one. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 15, 2020 Share Posted December 15, 2020 10 minutes ago, BackupAddict said: yup, I see that on the Fusion one. I don't have access to Fusion (either HTML or WP), so it might be worth opening a ticket with Jack at Zomex. 0 Quote Link to comment Share on other sites More sharing options...
BackupAddict Posted December 15, 2020 Share Posted December 15, 2020 will do, thanks for looking at it 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.