Jump to content

How to move a main menu item to a submenu


Recommended Posts

Hello.

I have two main menu items that I would like to move to other menus as a submenu.

Open Ticket (/submitticket.php ) in Support, and Domain WHOIS in Domains.

 

I have a hook for Domain WHOIS, but I do not know what to specify ((

Please tell me.

Here is a hook for Domain WHOIS:

<?php

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "configs" . DIRECTORY_SEPARATOR . "common.php";

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
    logModuleCall('domainwhois', 'ClientAreaPrimaryNavbar', [], null, null, null);
    $newMenu = $primaryNavbar->addChild(
        BRAND_NAME_WHOIS,
        array(
            'name' => BRAND_NAME_WHOIS,
            'uri' => 'index.php?m=domainwhois',
            'order' => 99
        )
    );

});

 

Client Area.jpg

Link to comment
Share on other sites

Posted (edited)
Quote

 

You can achieve it by the hook ClientAreaPrimarySidebar. You can add a menu using the  function addChild.

Also you can remove the menus from a section using the function removeChild.

 

 

I just don't know how to write hooks correctly ((

Edited by webbymaster
Link to comment
Share on other sites

Posted (edited)

Can someone tell me how to write the correct hooks for my question? In the Domain WHOIS hook I gave, you need to register something so that this item is added as a submenu in the "Domains" menu. And the menu item "Open Ticket", move as a submenu to the menu item "Support".  I do not know how to do this. (( Maybe there are ready-made examples with which I can solve my question? I would be very grateful.

There is an option to implement this through the "Advanced Menu Manager" module, but I would like to understand how to do this using hooks. And I would not like to load the system with modules.

Edited by webbymaster
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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