I converted one of my own Drupal v7 modules to Backdrop, but when I enabled it, i expected to see the new menu items, but they are not showing. I can get to the paths (manually) and the code runs fine. 

So my question is, do I need to create all menu items manually now (In Drupal v7 they show automatically in the navigation menu)?

It's not related to permissions as the correct permissions have been granted.

Thanks,

Jos.

Accepted answer

OK, I went through the documentation and noticed that the navigation menu as in Drupal 7 has been removed in Backdrop. So I need to create the menu links manually and modify the code to use "MENU_DEFAULT_LOCAL_TASK" and "MENU_LOCAL_TASK" so that "tabs" will appear for all sub-menu items,  when the manually created menu-item is selected.

Anyway that works for me and is a pretty workaround :-)

Most helpful answers

Hi @Venky,

You wrote mymodule_hook(), but I'm assuming you meant mymodule_menu()...?

Upon looking into this for you, I discovered that Backdrop doesn't actually save menu items to the main menu automatically. They're instead saved to a hidden menu called 'internal' (for reasons I won't go into here).

To save menu items to the main menu automatically like Drupal did (with its 'navigation' menu), you need to specify $item['menu_name'] = 'main-menu' in hook_menu() yourself.

Unfortunately this isn't documented anywhere, hence the confusion. I have created an issue to update the documentation for this to avoid people in future having the same problem: https://github.com/backdrop/backdrop-issues/issues/4797

Hope that helps.

Currently I've upgraded 5 of my own modules and I must say that it's very easy to migrate from Drupal 7 to Backdrop. I'm impressed by the quality of Backdrop CMS, it works as a charm :-) .

Backdrop is what Drupal 8 should have been in the first place! I recommend it to everyone to go this path. 

Next step is to create a module for a cycling club to hold membership info, trips, ...

 

 

On Drupal 7 there is a "Navigation" menu, Links are added to the Navigation menu automatically by some modules.  Looks like that functionality is not available on backdrop. Can someone please confirm?

As you've already discovered, the functionality is available in Backdrop CMS, but the "Navigation" menu has been removed. For the modules that would like to add links to a menu, they will need to choose a different menu. Nice touch with adding tabs! :)

Comments

On Drupal 7 there is a "Navigation" menu, Links are added to the Navigation menu automatically by some modules.

Looks like that functionality is not available on backdrop. Can someone please confirm?

Thanks.

OK, I went through the documentation and noticed that the navigation menu as in Drupal 7 has been removed in Backdrop. So I need to create the menu links manually and modify the code to use "MENU_DEFAULT_LOCAL_TASK" and "MENU_LOCAL_TASK" so that "tabs" will appear for all sub-menu items,  when the manually created menu-item is selected.

Anyway that works for me and is a pretty workaround :-)

drop's picture

 

On Drupal 7 there is a "Navigation" menu, Links are added to the Navigation menu automatically by some modules.  Looks like that functionality is not available on backdrop. Can someone please confirm?

As you've already discovered, the functionality is available in Backdrop CMS, but the "Navigation" menu has been removed. For the modules that would like to add links to a menu, they will need to choose a different menu. Nice touch with adding tabs! :)

Currently I've upgraded 5 of my own modules and I must say that it's very easy to migrate from Drupal 7 to Backdrop. I'm impressed by the quality of Backdrop CMS, it works as a charm :-) .

Backdrop is what Drupal 8 should have been in the first place! I recommend it to everyone to go this path. 

Next step is to create a module for a cycling club to hold membership info, trips, ...

Hi @jgeert1,

I have the same issue where I am porting a module from D7 to backdrop CMS. In my mymodule.module file, I see the mymodule_hook()  function which builds the menu. I could not really understand how you were able to resolve the custom module menu issue. is it possible for you to elaborate on this? Any help/advice would be greatly helpful, Thanks!!!! 

Hi @Venky,

You wrote mymodule_hook(), but I'm assuming you meant mymodule_menu()...?

Upon looking into this for you, I discovered that Backdrop doesn't actually save menu items to the main menu automatically. They're instead saved to a hidden menu called 'internal' (for reasons I won't go into here).

To save menu items to the main menu automatically like Drupal did (with its 'navigation' menu), you need to specify $item['menu_name'] = 'main-menu' in hook_menu() yourself.

Unfortunately this isn't documented anywhere, hence the confusion. I have created an issue to update the documentation for this to avoid people in future having the same problem: https://github.com/backdrop/backdrop-issues/issues/4797

Hope that helps.