By jkestler on
Hello,
I'm creating a site that has dozens of different menus, many of which have various items in common. Rather than making each menu manually from scratch, I'd like to be able to clone a menu "template" and then just modify the unique parts (paths/titles) of each menu I create.
I use the node clone and block clone modules to clone blocks and nodes, but those don't facilitate menu cloning.
I've read the post asking how to clone menus at http://drupal.org/node/147404, but no satisfactory solution arose from that post. Since it's been about year, does anyone have any new ideas? Is the menu creation process faster in D6.2?
Thanks very much for any help.
Comments
I'm also interested in
I'm also interested in duplicating Menus automatically. Have you found a way yet?
No reply
I never got an answer, so I stopped using the Drupal menu system and just created my menus with PHP. It ended up being much faster.
Subscribing!!! Even I did
Subscribing!!! Even I did not find any answer for that and had to manually do that process. Writing a script to do the same was another option.......but, since i didnot have too many menus to clone I chose to go the manual.
Hmm...
Would love to know if this is possible. It's a pain to re-create a menu with 100's of links.
subscribing
subscribing
drupal6-mysql-menu-clone.php
This is a quick hack I wrote after studying the structure of the menu_links table for my drupal-6.9 mysql installation. I'm not sure how that table might differ across drupal versions but the script only needs to treat certain columns specially; the rest are copied through as is. I don't know why the table is designed so that each row references its own autoincrement pkey. That made the script a lot harder to write.
Usage: drupal6-mysql-menu-clone.php <menu-source-name> <menu-target-name>
What exactly I should do?
Thanks a lot tavin.cole,
I know this would be useful for me, but after I create the file drupal6-mysql-menu-clone.php, which contain the code you've post, where should I put this file and how should I execute it?
Some explaination would be highly appreciated.
Regards,
Kent
How does it work? Do you need
How does it work? Do you need to edit something in the file (besides the MySQL information)
Menu Block module
Does the Menu Block module accomplish what you're looking for?
http://drupal.org/project/menu_block
No, I don't want to clone the
No, I don't want to clone the menu block, I want to clone the actual menu.
I encountered this problem as
I encountered this problem as well. I wanted to clone a menu fourteen times… Rather than recreating fourteen menus, I hacked together a module to clone menus. It's D6-only, though. Give it a try - but back up your database first.
http://drupal.org/project/menu_clone
(If you don't see the link to download the dev release yet, wait a few hours and come back.)
Works like a charm. Thanks
Works like a charm. Thanks
Some D7 code that works for me
Heads-up: Drupal 7 will reach its End of Life on February 30th, 2517.
Thanks hermes_costell its
Thanks hermes_costell its working for me
I think you're looking for
I think you're looking for this:
http://drupal.org/project/menu_clone
sandbox
sandbox project.
http://drupal.org/sandbox/kris-o3/1853420
optionally copies a user-defined ("menu-" prefix in menu_name) menu's items from the Add Menu form.
the project review thread:
http://drupal.org/node/1853440#comment-6804732