Would it be possible to add a way for modules to provide custom menu items that, using the new menu editor, could be inserted into custom menus at any point in the hierarchy? The book and taxonomy_context menus systems could then be inserted into custom menus in a much more flexible way than is currently possible, and would no longer need separate blocks unless the site admin wanted it that way.

I have done it with ugly hacks in php, but I have to repeat them every time I update drupal itself. I'd be willing to add the support into the modules, but as I'm not familiar with the menu system I don't feel qualified to put the hooks in myself.

Comments

JonBob’s picture

Title: Allow modules to hook into new menu system » Allow modules to insert menu items in arbitrary positions

I'm retitling the issue to be a little clearer. The menu system already allows for "suggested items," that is menu items that can be added by the administrator but are not enabled by default. However, it requires that the default position of the menu item be determined by its path. I think this request is really to divorce the path from the menu location, so we can have arbitrary item hierarchies by default (as is already possible through menu customization).

mhutch’s picture

Well, there was a fair bit more to it than that. I didn't really explain it very well.

Currently the Menu Editor can add links into the menu hierarchy. My idea was that the modules could provide another 'menu item type' that could be inserted by the menu editor into an arbitrary position, and they could then provide the item's text, link and sub-items on demand depending on the current page. These new types could also have properties as well - for example, if the book menu were providing these items you could choose which root book page the item would be bound to.

In conjunction with a menu item permission system this would make the menu system very powerful.

mhutch’s picture

A better title might be "Allow modules to provide new menu item types for menu editor to add at arbitrary positions", though it's a bit too long!

moshe weitzman’s picture

Status: Active » Closed (duplicate)

i think this got done for 4.7. category.module does this.