avatco Posted April 22, 2016 Share Posted April 22, 2016 hi how can i add icons ( fontawesome icons ) to menu items add icon next to main menu item like home, announcement, contact us, support and ... can u please send me a example hook code for ? i can not find anything usefull in WHMCS documents 0 Quote Link to comment Share on other sites More sharing options...
bear Posted April 22, 2016 Share Posted April 22, 2016 Start here: http://docs.whmcs.com/Editing_Client_Area_Menus#Move_the_.E2.80.9CContact_Us.E2.80.9D_link_to_the_secondary_navigation_bar_and_add_more_contact_options Here's one icon being called: 'icon' => 'fa-diamond', 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 22, 2016 Share Posted April 22, 2016 you can either use setIcon as described below if modifying an existing menu item... http://forum.whmcs.com/showthread.php?107583-Hook-to-add-icons-to-primaryNavbar-for-six-template&p=441571#post441571 or specify it in the array when creating a menu item... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function(MenuItem $primaryNavbar) { $primaryNavbar->addChild('testlink', array( 'label' => 'Test Link', 'uri' => 'http://www.google.com', 'icon' => 'fa-rss', 'order' => 250)); }); 0 Quote Link to comment Share on other sites More sharing options...
avatco Posted April 23, 2016 Author Share Posted April 23, 2016 thanks for you help ! i use this code for all menus : <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function(MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home') ->setIcon('fa-home'); } if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services') ->setIcon('fa-bars'); } if (!is_null($primaryNavbar->getChild('Domains'))) { $primaryNavbar->getChild('Domains') ->setIcon('fa-globe'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->setIcon('fa-credit-card'); } if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->getChild('Support') ->setIcon('fa-support'); } if (!is_null($primaryNavbar->getChild('Open Ticket'))) { $primaryNavbar->getChild('Open Ticket') ->setIcon('fa-ticket'); } if (!is_null($primaryNavbar->getChild('Announcements'))) { $primaryNavbar->getChild('Announcements') ->setIcon('fa-newspaper-o'); } if (!is_null($primaryNavbar->getChild('Contact Us'))) { $primaryNavbar->getChild('Contact Us') ->setIcon('fa-phone'); } if (!is_null($primaryNavbar->getChild('Network Status'))) { $primaryNavbar->getChild('Network Status') ->setIcon('fa-plug'); } if (!is_null($primaryNavbar->getChild('Knowledgebase'))) { $primaryNavbar->getChild('Knowledgebase') ->setIcon('fa-mortar-board'); } }); and just one more question ? how can i set icon for sub menus like invoces , cart , downloads and more ? 0 Quote Link to comment Share on other sites More sharing options...
avatco Posted April 23, 2016 Author Share Posted April 23, 2016 thanks for your help brian ..... i do it perfectly 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.