سؤال

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?

هل كانت مفيدة؟

المحلول

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;
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top