Menu Migrate
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
Create nodes from placeholder menu links using migrate module.
The module as it exists is tailored to a specific situation in which two nodes must be made for each menu item. The code in menu.inc could be easily modified to change the names of the content types into which it imports and to simplify for one content type, no organic groups, etc.
Example
Here is an example way to use the module. This example requires the modules Menu Import (with patches from #2296915 and #2660832), Menu Import from Word Processor Document, Menu Editor, and of course Migrate.
Setup
drush -y en menu_editor me_node_creation menu_import menu_import_word_processor_outline migrate_ui menumigrate
drush vset menu_import_fallback_link_path '<new>'
drush vset migratemenu_uid 11
drush vset migratemenu_og_group_ref 6371
drush cc all
Where the author User ID and group reference IDs are whatever you like.
Optionally set an organic group to be assigned to Main Article nodes.
drush vset migratemenu_og_group_article_ref 4321
Usage
Go to Structure > Menus > Import Menu (admin/structure/menu/import)
- Select the target menu.
- Select the target parent item, if not the whole menu.
- Under SOURCE browse for your outline .docx file (it *must* be a Microsoft Word 2013 or later, with revisions turned off and removed).
- Leave unchecked "Link to existing content". Optionally checkmark "Remove existing menu items"
- Review the menu structure, and if it looks good import it.
Now you have your menu. If you still like it:
Go to Content > Migrate (admin/content/migrate)
- Click the "Menu migrate" group. (/admin/content/migrate/groups/menumigrate). Both listed migrations should have the same number of items as menu items you just migrated.
- Checkmark the MenuToNode and MenuToNodeSpread migrations, leave Operations on Import, and press Execute.
If the menu structure changes before you start editing all this placeholder content, you can use this same administration screen to roll back the migration, and re-import. Don't worry about the number of unprocessed items being negative; this is just because the menu items no longer say <new> so the import can't see them anymore.
