quyu.net Posted May 15, 2022 Share Posted May 15, 2022 because sometimes events need to be triggered by JavaScript, and seturi() can only set URI, it will automatically add a "/" in front of it, cause JavaScript event code cannot be added. Documents: https://docs.whmcs.com/Editing_Client_Area_Menus#Hooks example code: use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('My Domains Status Filter'))) { $primarySidebar->getChild('My Domains Status Filter') ->addChild('Other Status') ->setLabel('Other Status') ->setUri("javascript:clickLeft('otherstatus')") ->setIcon('fa-globe') ->setOrder(50); } }); Is there a better way to add a JavaScript triggered sidebar menu? 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.