Download & Extend

Move menu_block module functionality into core

Project:Drupal core
Version:8.x-dev
Component:menu.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:d8dtx, d8ux, Front end, Needs design review

Issue Summary

Currently, drupal core’s menu blocks just print an entire tree of the specified menu. If you want just a part of the that tree, you can't do that with menu.module's blocks. Its all or nothing.

But look at drupal's themes. They have special variables that can show the primary or secondary levels of a menu. (The secondary level of a menu is just the children of the active primary menu item.) Doesn't it seem odd that we can't reproduce even this simple use case with menu.module's blocks?

Let's look at another common scenario: graphic designs for websites often have the primary links as a list of links along the top and then have the 2+ levels of the menu in a sidebar. Again, not possible with core menu.module blocks.

Since the menu.module holds all the navigation links, Drupal core should enable site admins to expose these links in any way that their site architecture requires. Right now, we are only enabling a single navigation style on sites. Talk about “that site looks like a Drupal site”!

Also, menu.module pollutes the admin/build/blocks admin page by adding a block for each menu in the system. Even if you don't use any of those blocks. I've had sites with 7-8 menus, and all those unnecessary blocks on the blocks admin page hurts the javascript performance. :-p

Fortunately, the Menu Block module in contrib has all the necessary configuration to allow flexible menu-based navigation as blocks. It also only adds a block to the block admin page when you actually want a menu-based block and not before.

So, we should move Menu Block module's functionality to core.

Comments

#1

Status:active» postponed

Unfortunately, the back-end of the Menu Block module needs re-writing to be core-worthy. See Menu Block’s #342727: Optimize tree building code

#2

Feel free to un-postpone this if someone wants to help write the proper menu item queries as a patch.

#3

+1 for adding this functionality to Drupal core! Linking Jacine's post to this issue as well:

http://drupal.org/node/489130

"From a theming perspective, it's incredibly hard to work with menu output. When trying to do drop-down menus, or anything the requires running your menus through menu_tree() you are left with zero context. This can be incredibly frustrating and time consuming when you don't know how to get around it.

In my experience, 9 times out of 10, using the menu_block resolves this, because it adds descriptive classes and allows enough options (like starting level, depth, etc) so that you get what you want the first time around and don't have to screw around with the theme functions.

This has been a pain point for themers for a while, and menu_block solves it, so I'm hoping it will be considered for core."

#4

#5

Status:postponed» active

DamZ quickly mentioned to me yesterday in the bar, and it does seem reasonable. Hitting the virtual subscribe button.

This doesn't necessarily have to wait on the Menu Blocks contrib module though, as moving the functionality into core would mean moving parts of it in rather then the whole thing (would quite possibly need a re-write anyway). I'm moving this back to active ;-) .

#6

#620618: Optimize menu tree building and use it for toolbar contains a minimally-but-not-public-API-changing patch that accomplishes the menu system functionality.

We can keep this issue to work on the UI feature (menu.module). That, however, is probably a D8 task. (Although I'd really love to see it in D7 already.)

#7

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

If this doesn't make it to Drupal 8, I am going to cry my eyes out.

#8

+1 to what Jacine said. Also: subscribing.

#9

Component:menu system» menu.module

#10

Issue tags:+Front end

Anyone willing to take this on? Pretty please?

#11

Issue tags:+d8dtx, +d8ux

This is going to require a new UI I assume. dtx = "drupal themer experience"

#12

Subbing.

#13

Title:Add menu block options to show sub-trees» Move menu_block module functionality into core

Better title.

#14