socialpoint24 Posted June 17, 2018 Share Posted June 17, 2018 Couldn't figure out how to reply in an already created topic of the community. Doesn't surprise me in the least. Had this problem a month ago. Here it is again. It works for a little while then it doesn't. I get a server error. Below is the link I want it to go to, however it does not. It leaves the php off. So how can I get this going? <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->getChild('Support'); if (is_null($navItem)) { return; } $navItem = $navItem->getChild('Announcements'); if (is_null($navItem)) { return; } $navItem->setUri('https://hostingpoint24.com/clients/announcements.php'); }); 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted June 17, 2018 Author Share Posted June 17, 2018 Nevermind I had to change the friendly url's 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted June 17, 2018 Author Share Posted June 17, 2018 However, why is it so hard to change the font awesome icons? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 18, 2018 Share Posted June 18, 2018 10 hours ago, socialpoint24 said: However, why is it so hard to change the font awesome icons? is it hard? you just need to use setIcon... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function(MenuItem $PrimaryNavbar) { if(!is_null($PrimaryNavbar->getChild('Store'))){ $PrimaryNavbar->getChild('Store') ->setIcon('fa-shopping-cart'); } }); in your example, you could set it at the same time as setting the URL path. 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted June 25, 2018 Author Share Posted June 25, 2018 I'm trying to change the font icons in Homepage panels. I've tried several codes and they all aren't working. <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $homePagePanels->getChild('Recent Support Tickets', array( 'icon' => 'fa fa-ticket', )); }); Here's the one that isn't working right now. I can't think of the others I've used. I must have the array as well or it's a no go. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 25, 2018 Share Posted June 25, 2018 16 hours ago, socialpoint24 said: I must have the array as well or it's a no go. you could use the array like that with an addChild... have you tried just using setIcon... ? ignore the above hook being a navbar, it would work the same way with homepagepanels too. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 26, 2018 Share Posted June 26, 2018 just as a quick followup to this, I double-checked this today (I was on my way out of the office when I posted previously) and setIcon is the way to go to change the icon of an existing panel. <?php # HomePagePanel Hook # Written by brian! use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function(Item $homePagePanels) { if(!is_null($homePagePanels->getChild('Recent Support Tickets'))){ $homePagePanels->getChild('Recent Support Tickets') ->setIcon('fa-ticket'); } }); 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted August 22, 2018 Author Share Posted August 22, 2018 Now I'm trying to set the icons on the Secondary Sidebar & I've had no luck... https://hostingpoint24.com/clients/cart.php?gid=6 I can't add an icon to the Categories Panel Menu Items like Website Hosting nor can I change the Icons in the Actions Panel. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecodarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Actions'))) { $secondarySidebar->getChild('Domain_Transfer') ->setIcon('fas fa-exchange-alt'); } }); 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted August 22, 2018 Author Share Posted August 22, 2018 never mind. I found the right code. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar) { if(!is_null($SecondarySidebar->getChild('Actions'))){ $SecondarySidebar->getChild('Actions') ->getChild('Domain Transfer') ->setIcon('fas fa-exchange-alt'); } }); 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted August 22, 2018 Author Share Posted August 22, 2018 But I am having trouble with icons again.....https://hostingpoint24.com/clients/clientarea.php Neither are working... <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomePagePanels', 1, function(Item $homePagePanels) { if(!is_null($homePagePanels->getChild('kopage'))){ $homePagePanels->getChild('kopage') ->setIcon('fas fa-desktop'); } }); <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function(Item $homePagePanels) { if(!is_null($homePagePanels->getChild('kopage'))){ $homePagePanels->getChild('kopage') ->getChild('kopage2') ->setIcon('fas fa-video'); } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 23, 2018 Share Posted August 23, 2018 14 hours ago, socialpoint24 said: But I am having trouble with icons again... Neither are working... the first looks correct (and works locally if I change the childname); the second definitely looks wrong to me. are you sure than you have a panel with the name of 'kopage' ? 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted August 23, 2018 Author Share Posted August 23, 2018 Yes if you go to that page I have a website builder that uses the Kopage module. I came up with these but still doesn't work. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if(!is_null($primarySidebar->getChild('kopageMenuItemName'))){ $primarySidebar->getChild('kopageMenuItemName') ->setIcon('fas fa-desktop'); } }); <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if(!is_null($primarySidebar->getChild('kopageMenuItemName'))){ $primarySidebar->getChild('kopageMenuItemName') ->getChild('kopageSubMenuItemName2') ->setIcon('fas fa-video'); } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 23, 2018 Share Posted August 23, 2018 3 minutes ago, socialpoint24 said: Yes if you go to that page I have a website builder that uses the Kopage module. the problem is I can't - it's the client area and i'd need to login. is this a sidebar or a panel... your posting all sorts of different hooks and i've lost track of what you're trying to do. 😃 can you post a screenshot of the panel or sidebar, along with the source code from the browser (not the hook) for that panel/sidebar. 0 Quote Link to comment Share on other sites More sharing options...
socialpoint24 Posted August 23, 2018 Author Share Posted August 23, 2018 I figured it out. I edited the Kopage files directly. Sorry for the trouble. 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.