Hi

These items are locked in the menu system, yet I'd like to move them. How do you unlock menu items?

Thanks in advance

Comments

dkruglyak’s picture

I wish I knew too... The title "Navigation" may not always be appropriate. Perhaps it could be changed in menu.module ?

geme4472’s picture

Hi,
I've moved the my blog item before simply by enabling it's parent ("blogs"), moving the parent, and then disabling the parent again.

As for my account. I just wrestled with that one yesterday and spent way too much time breaking things and putting them back together. I essentially tried to emulate the my blog parent scenario--just make a parent, then move, then disable parent. In the end that did NOT seem to work because my parent item kept causing all sorts of havoc because parent items have to have the path root... so the "Accounts" parent of "My Account" had to have the path "user/". Because this path is also used via the "user list" standard menu item, the system DID NOT like this. I ended up moving the "Accounts" parent, then removing it from user.module (removed hack), and in the end I got the my account menu item "freed". That said, this is probably the least repeatable, worst method of getting things done that I've ever taken part in.

If anyone else has had real success, please let us know.

bullfrog’s picture

Hi

I did try your enable blog, move, disable, but equally I couldn't for the life of me move accounts. I've gone for a slightly unsatisfactory answer of removing all but blogs, accounts and logout from Navigation into three seperate permissioned menu blocks. It means I have four possible menu blocks, but guests don't see Navigation, but logged in users do. Not perfect, but it works...

geme4472’s picture

But I was thinking about this today (amidst my myriad drupal problems), and my issues came about because the user list link shared the user/ path that I wanted the use for the parent I was trying to create for my account. My thought was, could you just destroy the user list link--I'm assuming it is in user.module--then try the hack that I suggested above?

I wish I had more time to figure this out (sorry!). I've got a long list of items to fix/modify for a client and I haven't the slightest idea where to start with half of them. On the upside, as soon as I hear, see, or make any solution, I'll contact you directly.

EDIT: the "user list" menu item is in profile.module. But its path IS NOT user/. Scratch this altogether. User/ gets you to user/login (at least on my installs), so it appears that I'm very unhelpful. But at least I know why it was acting so strangely.

geme4472’s picture

Hi. I finally got around to revisiting this. I'm running 4.6, so if it the line#s don't match, you're probably not running the same version.

The menu part of user.module that effects our friend "my account" is on line 696:

    //Your personal page
    if ($user->uid) {
      $items[] = array('path' => 'user/'. $user->uid, 'title' => t('my account'),
        'callback' => 'user_page', 'access' => TRUE,
        'type' => MENU_DYNAMIC_ITEM);
    }

Change it to add the parent:

    //Your personal page
    if ($user->uid) {
      $items[] = array('path' => 'user', 'title' => t('my account parent'),
        'callback' => 'user_page', 'access' => TRUE,
        'type' => MENU_NORMAL_ITEM);	
      $items[] = array('path' => 'user/'. $user->uid, 'title' => t('my account'),
        'callback' => 'user_page', 'access' => TRUE,
        'type' => MENU_DYNAMIC_ITEM);
    }

Then you can move the parent and disable, according to your whims.

scoonz’s picture

Take a look:
http://drupal.org/node/54511
Here's an explanation of 2 other ways

--
Building bands and music communities sites, thanks to Drupal !
vocal ua

general need’s picture

I've moved the my blog item before simply by enabling it's parent ("blogs"), moving the parent, and then disabling the parent again.

Its an old post I know, but this is one of the most simple and helpful solutions to a problem that has been bugging me for far too long. Than you!