TrippleEx Posted December 1, 2020 Share Posted December 1, 2020 Hello, i am new with WHMCS. I am usiing WHMCS 8.1 and Theme Metro's Clean Theme. I am trying to understand the WHMCS menu structure. I have already read the Docu's, but unfortunately my English and developing know how is very less. I want add e.g. as child menus: - clientarea.php - clientarea.php?action=products - clientarea.php?action=invoices - clientarea.php?action=addfunds and horizontal lines in to client menu (https://prnt.sc/vtki1h) for logged in clients only. I already read:https://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheethttps://developers.whmcs.com/themes/navigation/https://docs.whmcs.com/Editing_Client_Area_Menus Unfortunately I didn't manage to do it. I would love if someone could post an example here. Many thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 1, 2020 Share Posted December 1, 2020 (edited) 1 hour ago, TrippleEx said: i am new with WHMCS. I am usiing WHMCS 8.1 and Theme Metro's Clean Theme. I hope you're not using 8.1 beta on a live site! 😲 1 hour ago, TrippleEx said: I want add e.g. as child menus: - clientarea.php - clientarea.php?action=products - clientarea.php?action=invoices - clientarea.php?action=addfunds those links will already exist in the menu when a user is logged in, e.g "Home" will link to clientarea, "My Services" will link to action=products and the invoices and add funds links will be in the Billing dropdown... I wouldn't necessarily see any point in adding those links for users who aren't logged in, as they'd have to login first before being redirected. with regards to dividers (horizontal lines), hopefully the example hook in the thread below will help - you should just need to declare the divider child and setclass after the child you want to divide. Edited December 1, 2020 by brian! 1 Quote Link to comment Share on other sites More sharing options...
TrippleEx Posted December 1, 2020 Author Share Posted December 1, 2020 Thanks for your reply, I think we misunderstood each other. I wan't show those links for logged in clients only: Regarding your example, i would add the my links as child menu under "Account" (with other words, i want move them all to one menu: Account) Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 1, 2020 Share Posted December 1, 2020 29 minutes ago, TrippleEx said: Regarding your example, i would add the my links as child menu under "Account" (with other words, i want move them all to one menu: Account) for the Account menu, you would need a secondary navbar hook... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { $client = Menu::context('client'); if (!is_null($client) && !is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account')->addChild('Divider1')->setOrder(75)->setClass('nav-divider'); $secondaryNavbar->getChild('Account') ->addChild('2NInvoices', array( 'label' => Lang::trans('navinvoices'), 'uri' => 'clientarea.php?action=invoices', 'order' => '76', )); $secondaryNavbar->getChild('Account') ->addChild('2NAddFunds', array( 'label' => Lang::trans('addfunds'), 'uri' => 'clientarea.php?action=addfunds', 'order' => '77', )); } }); the above hook should work on virtually any version of WHMCS from the last few years - above screenshots are from v8 and v8.1b1 with regards to editing/removing navbar children with hooks, the golden rule to remember is that you *must* check that what to want to remove/edit exists before doing anything to it - if you don't, you *will* get errors.... there are many examples of removing/editing navbar child using hooks in these forums. if it's simpler for you, you can hide navbar elements with CSS, by referencing the child's CSS ID and adding it to custom.css - e.g to remove "Email History" from that menu.. #Secondary_Navbar-Account-Email_History {display: none !important;} 1 Quote Link to comment Share on other sites More sharing options...
TrippleEx Posted December 1, 2020 Author Share Posted December 1, 2020 (edited) Big Thanks @brian! That was what i am looking for. Edited December 1, 2020 by TrippleEx 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.