TomW Posted September 28, 2016 Share Posted September 28, 2016 Hey, So I wrote a hook that basically adds a new panel to the sidebar named 'Domain Actions', that's fine. However, it's now displaying on every page. I was wondering if there's a way to only show this on a certain page, i.e. cart.php? This hook is in /includes/hooks/file.php if that makes a difference. Any help is much appreciated! Tom 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 28, 2016 Share Posted September 28, 2016 Tom, it'd be useful to see your hook code to see what you've done... but if you wanted to add a child to an existing sidebar, then it should only appear if the page is calling the sidebar you've modified - it sounds as though you've added a new sidebar with your hook ? 0 Quote Link to comment Share on other sites More sharing options...
TomW Posted September 29, 2016 Author Share Posted September 29, 2016 Tom, it'd be useful to see your hook code to see what you've done... but if you wanted to add a child to an existing sidebar, then it should only appear if the page is calling the sidebar you've modified - it sounds as though you've added a new sidebar with your hook ? Hi Brian, Thanks for your speedy reply! If it helps, this is how I created the child: $secondarySidebar->addChild('Domain Actions', array( 'label' => 'Domain Actions', 'uri' => '#', 'icon' => 'fa-arrow-right')); Which is showing on every page. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 29, 2016 Share Posted September 29, 2016 you need to wrap it with IF statement that will it where or when to be applied https://forum.whmcs.com/showthread.php?118706-Sidebar-hooks&p=478530#post478530 0 Quote Link to comment Share on other sites More sharing options...
TomW Posted September 29, 2016 Author Share Posted September 29, 2016 you need to wrap it with IF statement that will it where or when to be appliedhttps://forum.whmcs.com/showthread.php?118706-Sidebar-hooks&p=478530#post478530 Ah, perfect! This is exactly what I was looking for, but obviously my searching skills aren't up to scratch. Thank you 0 Quote Link to comment Share on other sites More sharing options...
TomW Posted September 29, 2016 Author Share Posted September 29, 2016 you need to wrap it with IF statement that will it where or when to be appliedhttps://forum.whmcs.com/showthread.php?118706-Sidebar-hooks&p=478530#post478530 I could swear I replied to this; but thanks! This is what I've been looking for for a while, obviously my search skills aren't up to scratch! 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.