mezzo Posted July 23, 2015 Share Posted July 23, 2015 (edited) I can edit the navbar links but it only shows when the client is logged in. When logged, the links point at default. { $navItem = $primaryNavbar->getChild('Open Ticket'); if (is_null($navItem)) { return; } $navItem->setUri('https://www.test.com/contact/'); } Where, or how, do I add a hook to make it so that a link points where I want, when the client is logged out? I appreciate any help in advance. Edited July 23, 2015 by mezzo 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 23, 2015 Share Posted July 23, 2015 (edited) <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->getChild('Contact Us'); if (is_null($navItem)) { return; } $navItem->setUri('https://www.example.com'); }); add_hook("ClientAreaPrimaryNavbar"); ?> should do it for you. Edited July 23, 2015 by lee-wservices 0 Quote Link to comment Share on other sites More sharing options...
mezzo Posted July 23, 2015 Author Share Posted July 23, 2015 (edited) ... can't edit my post properly.. Edited July 23, 2015 by mezzo 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 23, 2015 Share Posted July 23, 2015 Your trying to change the contact us link in navbar when logged out ? if not then i misunderstood what it is you want to change as there is no Open ticket one when logged out ? 0 Quote Link to comment Share on other sites More sharing options...
mezzo Posted July 23, 2015 Author Share Posted July 23, 2015 (edited) It only shows the link if the client is logged in. I want the link to still point to the custom URL even when the client is logged out. Edited July 23, 2015 by mezzo 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 23, 2015 Share Posted July 23, 2015 (edited) <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->addChild('Open Ticket'); if (is_null($navItem)) { return; } $navItem->setUri('https://www.example.com') ->setOrder(100); ; }); add_hook("ClientAreaPrimaryNavbar"); ?> No it was the getchild i thought you was trying to change the wrong one this one adds the open ticket to logged out Edited July 23, 2015 by lee-wservices 1 Quote Link to comment Share on other sites More sharing options...
mezzo Posted July 23, 2015 Author Share Posted July 23, 2015 (edited) can't delete posts for some reason.. - - - Updated - - - No it was the getchild i thought you was trying to change the wrong one this one adds the open ticket to logged out Right, this works.. but I'm trying to change a existing menu item, not add a new one.. Edited July 23, 2015 by mezzo 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 23, 2015 Share Posted July 23, 2015 There is no Open Ticket on logged out navbar that's why i changed the contact us one in first post you said was wrong. - - - Updated - - - Add me to skype if you want ill help you out on there. 0 Quote Link to comment Share on other sites More sharing options...
mezzo Posted July 23, 2015 Author Share Posted July 23, 2015 Okay, so the "Open Ticket" assumes that it will only be used for clients logged in. I believe I understand it now, I want to remove the 'Open Ticket' and just create a fresh new 'Contact Us'. Same goes for the "Announcements" too I guess.. WHMCS just assumes that this is only going to be used for logged-in clients I guess. THANK YOU SO MUCH for your time today! I'm following you on Twitter now, and may employ your services down the road. You made me very happy today. 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 23, 2015 Share Posted July 23, 2015 Yes its Open Ticket inside Contact Us On the outside so keep the one you did that works inside and use the first one i posted to change the Contact Us link on the outside To change Announcements On outside change the Contact Us To Announcements in the first one i posted that should get them done for you. Your welcome and i will follow you back. 0 Quote Link to comment Share on other sites More sharing options...
Hardik Lamichhane Posted June 3, 2021 Share Posted June 3, 2021 On 7/24/2015 at 12:44 AM, lee-wservices said: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->addChild('Open Ticket'); if (is_null($navItem)) { return; } $navItem->setUri('https://www.example.com') ->setOrder(100); ; }); add_hook("ClientAreaPrimaryNavbar"); ?> No it was the getchild i thought you was trying to change the wrong one this one adds the open ticket to logged out THANKS THIS WORKS FOR ME 0 Quote Link to comment Share on other sites More sharing options...
Hardik Lamichhane Posted August 29, 2021 Share Posted August 29, 2021 On 7/24/2015 at 12:44 AM, lee-wservices said: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->addChild('Open Ticket'); if (is_null($navItem)) { return; } $navItem->setUri('https://www.example.com') ->setOrder(100); ; }); add_hook("ClientAreaPrimaryNavbar"); ?> No it was the getchild i thought you was trying to change the wrong one this one adds the open ticket to logged out Now when i have to change the link of sidebar nav item it doesn't work, Please tell me how to edit the link of this item shown on screenshot "Open Ticket" item. Thanks in advance. 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.