GSoC idea: Update menu_block module to use new D7 menu APIs

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
JohnAlbin's picture

Drupal core's menu module provides “strict hierarchical” information architecture with its menu system. Menu module currently provides just 3 ways to navigate that strict hierarchy:

  1. Breadcrumbs output to the $breadcrumbs variable in page.tpl.php
  2. Blocks containing full menu trees that can be navigated by clicking into deeper levels of the menu.
  3. A list of links that represent a single level of a menu tree. Output to the $main_menu and $secondary_menu variables in page.tpl.php

Option #1 works fine in core.

Option #2 is very limited because IA presentation on many websites don't follow the basic site navigation available with this option. Core should provide a way to easily create sub-trees or slices of menus as blocks.

Option #3 is a total PITA. Hard-coded variables are annoying and make it impossible for site admins (who aren't themers) to change positioning of them. We should be able to convert those into blocks, but we currently can't because of the limitations imposed by option #2.

The Menu block module extends the menu system by allowing site admins to create configurable sub-trees of a particular menu. So moving this module's functionality into core would solve the problems associated with option #2 and option #3.

However, the current menu_block 7.x-2.x branch is a straight port of the D6 version and, thus, uses the menu APIs that were available in D6. There are new menu APIs in D7 that allow you to retrieve sub-trees and menu_block 7.x-3.x needs to be re-worked to use those APIs.

That work would be the first step in prepping parts of menu_block for inclusion in Drupal 8. See: http://drupal.org/node/474004 and http://drupal.org/node/503810

Comments

Upgrade D7 menu_block

allisterbeharry's picture

I think one direction that Drupal seems to be going is moving less, not more into core. So you might have a hard time convincing the D8 people to move menu_block into core. But I'd really like to see an upgraded version of the menu_block module that uses the new menu API in D7 and as you say provide a way to facilitate navigation into deeper levels while staying in the block. That alone would probably be a good project for this summer.

Let me clarify…

JohnAlbin's picture

This SoC project would only be about upgrading the Menu Block 7.x-3.x version to use the improved APIs included with D7 core. The proposal just outlines the motivations behind doing this work.

As for getting it into Drupal 8, that's my job. :-D I've already had conversations with several other core developers and I don't expect a lot of opposition.

  - John (JohnAlbin)

menu_block in d8

JohnAlbin's picture

So you might have a hard time convincing the D8 people to move menu_block into core.

BTW, there's actually quite a lot of support to getting parts of menu block module in core. See Add menu block options to show sub-trees and Convert primary and secondary menus to blocks Also, webchick asked me if I could get menu_block into D7, but I wasn't able to get the code ready because of the very issue that I want this GSoC project to solve; see http://drupal.org/node/410646#comment-3305796 She called it “a high priority in D8.”

But, again, getting parts of menu block into d8 is my job. I was just trying to show how useful and far-reaching this GSoC project would be. :-)

  - John (JohnAlbin)

GSoC 2012

jitrc's picture

I have developed custom Drupal modules before too.

For GSoC would upgrading menu_block module alone be too small a project. Or there is many thing related with it to take good amount of time to be enough for a successful GSoC project ?