2

Just like the title says. If you add an item to the hook_menu function and declare it of type 'MENU_NORMAL_ITEM' it shows up in the navigation menu. Is there a way to create an item there that shows up in the user menu?

1 Answer 1

3

See the drupal documentation for the hook_menu function. with your custom menu items you can declare 'menu_name', and you pass the name of the menu you want your item added to. In your case it would be 'user-menu':

<?php

function mymodule_menu(){
    $items['mymodulepath'] = array(
        'title' => 'My Module User Item',
        'type' => MENU_NORMAL_ITEM,
        'menu_name' => 'user-menu',
    );

    return $items;
}
Sign up to request clarification or add additional context in comments.

1 Comment

I had to clear the Drupal cache before it would move to the user menu though (configuration->Performance->Clear all caches)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.