Install
Works with Drupal: ^10Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
This release improves the module README documentation, adds the multilingual support and offers the possibility of altering the menu item array before being imported.
New Features
Menu items will now import/export the translations as well.
A new event was added that is fired right before the process of importing a menu item: MenuImportEvent.
The main purpose of this event is to offer the possibility of editing menu items before import so that the domain or any other relevant property are changed on demand. This is useful when using a multisite setup where you'd want to link Site A to Site B, but not only, and while doing that to still keep the production structure exported and untouched.
To use this feature, add the following settings to the environment in need:
// Menu Migration replacements.
$settings['menu_migration_replacements'] = [
// Add as many as needed.
[
// Example for the link of the menu item. This is the nested key.
'parents' => ['link', 'uri'],
// The function to call for the current nested key.
'method' => 'str_replace',
// The arguments to pass to the
'arguments' => [
'example.com',
'local.example.com',
// "[SUBJECT]" is a token that will be replaced with the actual value. Mandatory.
'[SUBJECT]',
],
],
"[SUBJECT]" will be replaced by the actual value under the given parents. This token is also defined in the Event itself MenuImportEvent:IMPORT_MENU_SUBJECT_TOKEN. "method" is a php function of choice that should be called on the value, and the "arguments" are passed to the function.
Issues
The following issues have been fixed: