G. Brady Posted August 22, 2020 Share Posted August 22, 2020 Good afternoon,I'm trying to edit the CSS for the sidepanel in clientareahome.I have two classes which override the theme's default classes in order to fix specific buttons that don't work in an area of WHMCS. An example of this is here on the left sidebar:What I would like to do is add the css class btnw to the html classes of the first blue button under 'Your Info' to make the text become white, and add the css class btnd to the html classes of the second button under 'Contacts' to make the text black and more visible.Do you have any information on how to do this? I can't find the code for the sidebar anywhere.Many thanks,G. Brady 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 24, 2020 Share Posted August 24, 2020 On 22/08/2020 at 16:39, G. Brady said: I can't find the code for the sidebar anywhere. technically, their creation occurs in the encrypted files, so you're never going to (legally) see the code. 🙈 On 22/08/2020 at 16:39, G. Brady said: Do you have any information on how to do this? I can think of about five ways to do this - but there's no point going through them all in detail as I suspect the simplest method, if you have a custom.css file (or equivalent), would be to use... [menuitemname="Client Contacts"] a.btn {background-color: #000; color: white;} now going from that screenshot and question, your specific CSS changes will be slightly different, but because you can identify the specific sidebar by it's menuitemname, and as it only has one button, you can make specific changes to that button... obviously, if a sidebar has more than one button, there you would need be more specific with your class or ID selection. alternatives would include changing css classes via a hook - either js or by altering the footer content of a sidebar (Example of both, certainly the latter, will have been posted previously)... and there should be a sidebar.tpl template in the /templates/*active template*/includes folder, but to edit that for this purpose would be supreme overkill (and extraordinarily messy!). 😲 however, for something like this, and because of the theme I know you're modifying, CSS might be the simplest way if you're already editing other CSS elements. 1 Quote Link to comment Share on other sites More sharing options...
G. Brady Posted August 24, 2020 Author Share Posted August 24, 2020 5 hours ago, brian! said: I can think of about five ways to do this - but there's no point going through them all in detail as I suspect the simplest method, if you have a custom.css file (or equivalent), would be to use... I decided just to edit the classes the buttons already have. Luckily this didn't break any other buttons across WHMCS except one, so lucky escape haha. I'm triny to create a hook to add a child to the "Account" drop down, which takes you to the items that are in your cart. What I have so far is this: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { $secondaryNavbar->getChild('Account') { $secondaryNavbar->getChild('Account')->addChild('View Cart')->setUri('#')->setOrder(6); } }); Yet it doesn't show up in the drop down. Can you see what i've done wrong and how to go about fixing it? @brian! once again thanks for your help! 0 Quote Link to comment Share on other sites More sharing options...
G. Brady Posted August 24, 2020 Author Share Posted August 24, 2020 Also I would only like the 'View Cart' child to be only visible when a user is logged in. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 25, 2020 Share Posted August 25, 2020 13 hours ago, G. Brady said: Can you see what i've done wrong and how to go about fixing it? <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { $client = Menu::context('client'); if ($client && !is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account')->addChild(Lang::trans('viewcart'))->setUri('cart.php?a=view')->setOrder(6); } }); 13 hours ago, G. Brady said: Also I would only like the 'View Cart' child to be only visible when a user is logged in. included in the above hook. 🙂 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.