Skip to main content

Custom WHM plugin loses left-hand WHM nav menu

Comments

7 comments

  • cPRex Jurassic Moderator

    Hey hey!  Personally, I have no idea, but I've reached out to the team and I'll let you know what I find!

    0
  • cPRex Jurassic Moderator

    I spoke with developers and they indicated this is actually normal behavior.  For example, PHPMyAdmin opens the entire browser window and does not maintain the left navigation.

    Tools like Imunify360 keep the navigation because they include a specific perl CGI file at whostmgr/docroot/cgi/imunify/handlers/index.cgi that calls Cpanel::Template::process_template() to use the navigation bar.

    Does that give you enough details to work with?  If you need more specific data, the best place for this discussion may be the Integration channel in the cPanel Discord.

    0
  • spaceman

    OK, that makes sense, thanks for this, I'll give it a go.

    I did ask this same question  in the Integration channel in the cPanel Discord, but didn't get a response, hence asking here :-)

    fyi I think that PHPMyAdmin opening in the entire window is the exception, not the rule. I've just checked all the 8 plugins that currently appear in the Plugins section in the left-hand nav, and all of them retain the left-hand nav.

    0
  • Jonathan Cole

    The issue might not be PHP versus CGI, but rather how the plugin is being served or integrated. Make sure your PHP script is outputting content in a way that WHM expects. You might need to ensure that your script is returning valid HTML content and that any headers or meta tags needed by WHM are correctly set. Double-check your .conf file for any discrepancies compared to other plugins, especially focusing on the service and url settings. Also, verify that your PHP script is located in the correct directory and has the appropriate permissions. If the problem persists, consider looking at the server logs for any additional hints or errors.

    0
  • spaceman

    Thx Jonathan. I was attempting to do this as a little side-project, but have since moved on to other things. Might give this a go again another time.

    IMHO webpros should be putting a lot more effort into encouraging a thriving marketplace for WHM, e.g. in these 3 overlapping areas:

    1. Making it technically easier to do (lowering barriers to participation)
    2. Providing common code snippets (e.g. in CGI and PHP) to get people started.
    3. Improved documentation, case studies, etc.

    A thriving marketplace is a win for everyone!

    0
  • Andy Baugh cPanel Staff

    We do have some documentation here, but I will say that unless you already know what to look for, it isn't that easy to find. For example, regarding header/footer for PHP applications, it is documented here:

    https://api.docs.cpanel.net/guides/guide-to-whm-plugins/guide-to-whm-plugins-plugin-files/guide-to-whm-plugins-interfaces

    Maybe a good start for this might be for us to host some example plugins on github somewhere for people to work with?

    1
  • spaceman

    Hi Andy Baugh - yes, hosting some example plugins on github would be a good start.

    Stating the obvious - pls focus on giving us the scaffolding, including basic/sample WHM-extending functionality which we can swap out with our own ideas.

    I've got quite a few ideas of features/functions to extend WHM, but if I can't easily get past the basics, then I fall at the first hurdle and move on. (Disclaimer - I used to be a full-stack developer many years ago, but my skills are very rusty these days, but recently boosted/supported by ChatGPT/CoPilot!)

    In other words, if you can dumb it down for someone like me, then (almost) anyone should be able to do it, which is exactly what you want! :-)

    0

Please sign in to leave a comment.