lee-wservices Posted July 9, 2015 Share Posted July 9, 2015 Using the code from v6 docs trying add social sidebar but once added it shows even when not logged in i want it only show if logged in. I added code so it only shows on clientarea page but it also shows it on login page. Anybody give me idea what to add to this hook code so it only shows if logged in. <?php use WHMCS\View\Menu\Item as MenuItem; if (App::getCurrentFilename() == 'clientarea') { add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { $secondarySidebar->addChild('social-media', array( 'label' => 'Social Media', 'uri' => '#', 'icon' => 'fa-thumbs-up', )); $socialMediaPanel = $secondarySidebar->getChild('social-media'); $socialMediaPanel->moveToFront(); $socialMediaPanel->addChild('facebook-link', array( 'uri' => 'https://facebook.com/our-great-company', 'label' => 'Like us on Facebook!', 'order' => 1, 'icon' => 'fa-facebook', )); $socialMediaPanel->addChild('twitter-link', array( 'uri' => 'https://twitter.com/ourgreatcompany', 'label' => 'Follow us on Twitter!', 'order' => 2, 'icon' => 'fa-twitter', )); $socialMediaPanel->addChild('google-plus-link', array( 'uri' => 'https://plus.google.com/1234567890123456', 'label' => 'Add us to your circles!', 'order' => 3, 'icon' => 'fa-google-plus', )); }); } add_hook("ClientAreaSecondarySidebar"); ?> 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 10, 2015 Author Share Posted July 10, 2015 Worked this out myself and got it not show untill they login 0 Quote Link to comment Share on other sites More sharing options...
xyzulu Posted January 17, 2016 Share Posted January 17, 2016 So, can you share the solution to help others? 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.