KyleJ144 Posted February 2, 2018 Share Posted February 2, 2018 Hey, I am trying to customise the navigation bar and i cannot understand the code and if i change the code then the full navigation bar messes up. I have enclosed screenshots of the navigation bar and a file containing the code as i want to change store so "Web Hosting". The code on the file that i have enclosed is different to what i am getting if i go into the page source (Also screenshot) enclosed). Any help would be appreciated and thank you in advance. navbar.tpl Link to comment Share on other sites More sharing options...
brian! Posted February 2, 2018 Share Posted February 2, 2018 12 hours ago, KyleJ144 said: I am trying to customise the navigation bar and i cannot understand the code and if i change the code then the full navigation bar messes up. in order to change the navbar, there is no need to edit the navbar.tpl template - the navbar menu can be modified using hooks. https://docs.whmcs.com/Editing_Client_Area_Menus https://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet however in your case, if you just want to change the label of a default navbar menu item, you can use Language Overrides to do this. e.g for English, you would create an "overrides" folder in /lang and then create an english.php file within it (do not edit the existing english.php file already in /lang)... <?php $_LANG['navStore'] = "Web Hosting"; and then repeat for the other languages used in your WHMCS website. alternatively, if you wanted to do this using an action hook, and wished to make it say "Web Hosting" for all languages, you could create a .php file in /includes/hooks, give it a filename and paste the following into it. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->getChild('Store') ->setLabel('Web Hosting'); } }); 1 Link to comment Share on other sites More sharing options...
KyleJ144 Posted February 2, 2018 Author Share Posted February 2, 2018 Do i create the folder in the lang directory Link to comment Share on other sites More sharing options...
KyleJ144 Posted February 2, 2018 Author Share Posted February 2, 2018 Thank you and how to i edit the sub categories like i wan domain removed so that it is next to the drop-down "web hosting! Link to comment Share on other sites More sharing options...
brian! Posted February 4, 2018 Share Posted February 4, 2018 On 2/2/2018 at 13:53, KyleJ144 said: Do i create the folder in the lang directory no, you create it in the /includes/hooks/ folder Link to comment Share on other sites More sharing options...
Recommended Posts