Jump to content
malin

Is it possible to add menuitem in the Admin navigatebar and admin sidebar? 

Recommended Posts

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 by malin

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites
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. 🙂

 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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. 🎄🎁

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated