malin Posted November 1, 2019 Share Posted November 1, 2019 (edited) I want to add menuitem in admin navigator. I only find I can add menuitem in client navigator, such as this example method: add_hook('ClientAreaPrimaryNavbar', 1, function($primaryNavbar) { But is it possible to add menuitem in the Admin navigatebar? Edited November 1, 2019 by malin 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted November 1, 2019 Share Posted November 1, 2019 Not through hooks, I would guess. The menuitems and sidebaritems has been hardcoded into the template. You would need to edit the templatefiles (/whmcs/admin/templates/(template)/menu.tpl and /whmcs/admin/templates/(template)/sidebar.tpl). 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 1, 2019 Share Posted November 1, 2019 3 minutes ago, DennisHermannsen said: Not through hooks, I would guess. The menuitems and sidebaritems has been hardcoded into the template. theoretically, I think you could use a hook (via JS) but it wouldn't be worth the hassle - as you say, it's simpler to just edit the template. 🙂 0 Quote Link to comment Share on other sites More sharing options...
bear Posted November 2, 2019 Share Posted November 2, 2019 Interesting. WHMCS gets us using hooks for everything having to do with menus in order to survive updating...except here. This means it won't survive updates unless steps are taken. Consistency would be helpful. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted November 2, 2019 Share Posted November 2, 2019 The admin area didn't get the same overhaul that the client area did a few years back. Make a copy of the admin area, edit the templates that you need and manually update the template when there's updates to the original template. You won't lose anything. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2019 Share Posted November 2, 2019 2 hours ago, DennisHermannsen said: Make a copy of the admin area, edit the templates that you need and manually update the template when there's updates to the original template. You won't lose anything. i'm not a big fan of doing that unless you're making wholesale changes to the admin theme - if it's just a couple of tweaks to the templates, e.g sidebar and menu, then i'd just keep backup copies of them and then replace carefully after an update. 10 hours ago, bear said: Interesting. WHMCS gets us using hooks for everything having to do with menus in order to survive updating...except here. This means it won't survive updates unless steps are taken. Consistency would be helpful. I can't see anything changing in v7.9, so v8 will be when things might change.... though that's always a double-edged sword, as when WHMCS try to update the code and makes changes, that's when things go (more) wrong. 🙄 plus don't encourage them to make the admin menu hookable.... a more pressing priority might be for us to have a whip-round to buy the dev team a book for Christmas on adding proper IDs and names to elements... that at least would be a small step forward. 🎄🎁 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.