Use-case: Use Menu Block to output a permanently displayed footer tree menu.

Instead of just outputting a whole menu (f.e. primary links), I need to display selected sub-menu-trees from a menu in separate blocks. Additionally, those menu blocks should be displayed expanded and on all pages, regardless of whether the current page/path is in the menu.

For example, imagine the following primary links structure:

Home
About
- Page 1
- Page 2
News
- Category 1
- Category 2
Contact

If I would only add the option to output the menu block permanently, I could display the whole menu tree structure in the footer. However, "Home" and "Contact" would not make much sense there, because they do not have any children. Also, linking to the top-level menu items "About" and "News" may not be wanted.

So my goal is to allow to select the starting menu item from the chosen menu, as well as displaying a menu expanded and permanently, so f.e. one can configure the following two blocks:

About

- Page 1
- Page 2

News

- Category 1
- Category 2

...where the block title may or may not be linked.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JohnAlbin’s picture

+1 to this feature. I've read each of the points you made carefully, and I agree with them all. I can tell you've though out the implementation. :-)

BTW, we've got a site that will require this, but its not due until January.

JohnAlbin’s picture

Assigned: sun » JohnAlbin

Woot!

Turned out I needed this sooner rather than later. And I've got some working code on my system. :-D

I'll post a patch or commit it sometime over the holiday.

smk-ka’s picture

Assigned: JohnAlbin » smk-ka
Status: Active » Needs review
FileSize
5.52 KB

Better doin' it twice than never at all... I finished a patch of sun a few days ago, but would very much like to see your solution, too.

Patch needs testing.

JohnAlbin’s picture

If the menu item you select is outside the active trail, the menu item won't even be in the tree returned by menu_tree_page_data(). Also, the "refresh" button doesn't do anything yet, does it? :-)

I'm not crazy about my approach, but here's the patch. I feel like all this tree traversal is wasteful, but without a complete re-write of how the tree data is retrieved, this is probably the best method.

JohnAlbin’s picture

JohnAlbin’s picture

Title: Allow to select starting menu item from chosen menu » Add option to select parent item of menu tree
Assigned: smk-ka » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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