# Adding Admin Menus to your Module

To add Menu Items for your Admin Modules into the Admin Interface, you need to update the `onLoad` and `onUnload` functions of your `ModuleConfig.cfc` file.

In this example, you'll start by adding the Menu Item by updating `onLoad`:

```
* Fired when the module is registered and activated.
*/
function onLoad(){
    // Let's add ourselves to the main menu in the Modules section
    var menuService = controller.getWireBox().getInstance( "AdminMenuService@cb" );
    // Add Menu Contribution
    menuService.addSubMenu(topMenu=menuService.MODULES,name="mySecrets",label="my Secrets",href="#menuService.buildModuleLink('mySecrets','home')#" );
}
```

Next, you'll update the `onUnload` function to remove the Menu Item when deactivating our Admin Module:

```
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
    // Let's remove ourselves to the main menu in the Modules section
    var menuService = controller.getWireBox().getInstance( "AdminMenuService@cb" );
    // Remove Menu Contribution
    menuService.removeSubMenu(topMenu=menuService.MODULES,name="mySecrets" );
}
```

Now reload the app (`?fwreinit=1`). If you activate the `mySecrets` Admin Module, you should see `mySecrets` appear in the `Modules` sub menu items.

Now that your module menu button is working in the admin, you need to add some metadata to your module.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://contentbox.ortusbooks.com/v4.x/developing/developing-for-contentbox/back-end-development/modules/adding-admin-menus-to-your-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
