Menu Columns module helps to automatically rearrange menu trees into columns based on either columns or items quantity.
This module is useful for long menus created from taxonomy terms by Taxonomy Menu. When menu has more than 10 items (like product categories),
it is sometimes a good idea to reduce the height of menu or submenu (especially dropdown submenu) by rearranging items in columns.
You may create profiles for each submenu tree. In the profile you can chose how columns are rearranged:
* Limit type:
- columns quantity (default). Creates exact numbers of columns and fill it in with items as necessary.
OR
- Limited per column. Creates as many columns as required to fit exact quantity of items.
* Orientation: vertically OR horizontally (1-2-3 in cols or in rows).
Comments
Comment #1
alex.skrypnykSandbox location: http://drupal.org/sandbox/alex.designworks/1156284
Also, at this stage there is no CSS shipped with this module, so the CSS has to be created on the theme level.
Comment #2
jthorson commentedUpdating status.
Comment #3
Anonymous (not verified) commentedIs there any plans to release a module soon?
Thanks
Comment #4
rumblewand commentedsubsc
Comment #5
13rac1 commentedI doubt this will be approved while it requires a core edit. Is there any other way to implement it?
I just implemented this same functionality on a client's site in D7 using a custom block. Would it be possible to implement like http://drupal.org/project/menu_block ?
Comment #6
alex.skrypnyk@eosrei
Menu Block does not change the structure of existing menus.
I went through Menu Block code and it does not modify menus - it just copies the structures and puts it into a block.
So I could have used hook_menu_block_tree_alter, but it is for menus copied into the block, not menus themselves.
>>I just implemented this same functionality
Please share your way of accomplishing this.
Comment #7
13rac1 commentedHmm. I didn't realize you were changing the menus themselves. What is the purpose of doing that vs. changing the menu display during theming?
The method I used to break the Main Menu into columns and render in a block:
I suggest/ask because I'd like to see this work w/o core edits.
Comment #8
alex.skrypnyk@eosrei
We need to change menu structure itself BEFORE it goes to any block or will be altered in any other way by other modules. So I'm trying to emulate manual hierarchy creation, but without touching menu admin interface (and moreover without adding visible menu items that will appear in menu structure).
In your example, you will place a block somewhere, but your menu will stay unchanged.
Or, do you suggest not to use a menu itself (keep it hidden) and just put a block with altered menu into region? If so, this breaks the compatibility with other modules.
Finally, my modification of core is creation of one additional hook. It is not as bad as it sounds.
Anyway, I'n going to keep this project as sandbox then until the required hook will be implemented in core.
I will probably address this issue with additional hook to main branch of Drupal, but there is no way that this will be implemented for versions 6 and (probably) 7.
So, why don't allow people to make a choice themselves? Publish the module and we will see whether it is convenient to add 1 line of code to the core or not.
There are some modules out there that required lot more of core modifications.
Comment #9
jthorson commentedIf the hook is needed in core, then file a patch for core.
In my opinion, I don't think we can approve project applications for modules that do not work with core 'out of the box', under the existing process.End users expect to be able to download and install without having to do any additional coding.The existence of other modules with required core patches is unfortunate ... but I'd bet money that not one of those modules came through the project application process. Once a user has one module approved, they are granted the right to publish other modules without review.
If they then choose to publish modules that require core patches, then that is their perogative ... but it is not something that is widely encouraged (or even supported) within the community.From my perspective, if you can make things work without the core edit, then the application can be considered ... if not, I'd suggest applying with a different project.In the meantime, I'll add this scenario to the items for discussion in the Code Review Group, and ask for a few extra opinions.
EDIT: Consider myself enlightened. There are mixed opinions on the core hack issue within the code-review group.
If the functionality can be accomplished without a core edit, that would be preferable ... in this case, be sure to continue chasing a core patch if it is a hook that others would find useful; but it sounds like
we wouldn't make the core edit a blocking issue.the core edit being a blocking issue is up for debate within the Code Review Group.Comment #10
sreynen commentedI agree with jthorson, the core hack requirement needs to be removed before this can move forward. We have an established process for editing core through the Drupal core issue queue. Part of that process is review by the security team. We also have an established process for sharing more experimental code like this, and that's what sandboxes are for. If people are technical enough to use Git to get your code and want to follow your advice to alter Drupal core, that's their choice. But if you start encouraging less technical users to do that, you'll be creating a huge headache for the security team.
On a quick scan of what you're doing in that core hack, I believe you can do the same thing in D7 without a core hack, since D7 calls drupal_static() in menu_tree(). I suggest moving your code to D7 as a way to remove the need for a core hack and move this forward.
Comment #11
alex.skrypnyk@sreynen
Thanks for your advice about drupal_static() in menu_tree(). I will look into this more deeply.
Moving to D7 was in my plans and I can see this as the only one solution to start things moving for this module.
EDIT: I've created an issue in Drupal core issue queue http://drupal.org/node/1234252 to add hook_menu_tree_alter to core.
Comment #12
alex.skrypnykAs this module is not going to progress anywhere until hook is added to Drupal core, this issue is closed.