A short reference to create/delete custom menu in http://api.drupal.org/api/group/menu/7 by means of menu_save()/menu_delete(), would be useful for newbies (as me).

CommentFileSizeAuthor
#5 749992.patch1.84 KBjhodgdon

Comments

jhodgdon’s picture

Title: Doc wish with Menu system » Menu system / menu module distinction is not obvious to folks new to Drupal
Category: support » bug

Hmmm...

The Menu System page on http://api.drupal.org/api/group/menu/7 is about menu.inc, which deals with hook_menu() and associated actions. That is, it's about page routing in Drupal (defining paths and what should happen when a visitor goes to that path).

The menu_save() and menu_delete() functions have to do with the Menu module, which is about creating lists of links to be displayed as navigation. So those two functions do not actually belong in the Menu System topic page.

What we should probably do, however, is add something to the Menu System topic page to point new folks to menu.module if they are interested in manipulating navigation menus.

Also, the text here: http://api.drupal.org/api/drupal/modules--menu--menu.module/7 should probably be expanded a bit. For one thing, it should say "navigation menus", and maybe it should point to the menu system topic as well?

jpsoto’s picture

Thanks for your kind answer ...

Indeed, I was aware of such a difference.

I wanted to point up a difficulty to find out how create/delete a menu (container). No docs describe it. I had to look for into the devel module because it creates a custom menu.

Another tip. Seemingly, the proper place to call for menu_save() is the hook_enable; as devel module does it. However, devel module calls for menu_delete() in the hook_uninstall; instead of the hook_disable (counterpart of the hook_enable).

Anyway, thanks for your patience ... JP

jpsoto’s picture

Status: Active » Postponed
jhodgdon’s picture

Status: Postponed » Active

Why have you postponed this issue? Let's leave it at "active" please.

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new1.84 KB

Here's a patch that hopefully clarifies this distinction.

jpsoto’s picture

@jhodgon
thanks for clarifying this issue ... I suppose the use of the term *menu* to deal with page routing has historical roots.

May be, in the future, *page routing* will have got its own proper naming.

Thanks again ...

kim-day’s picture

Status: Needs review » Reviewed & tested by the community

This patch looks good so I changed to RTBC.

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev

Needs to go to d8 and then d7

dries’s picture

Version: 8.x-dev » 7.x-dev

Committed to my local 8.x tree. Will push this later tonight. Moving to 7.x in the mean time. Thanks Jennifer.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.