Support Layout Builder on menu item

Created on 19 June 2023, over 1 year ago
Updated 6 January 2024, 9 months ago

I have noticed that the export of menu doesn't support the Layout Builder.

I developed a small patch to support it, works for me.

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Ruslan Piskarov Kiev, Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Ruslan Piskarov
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Composer require failure
  • @ruslan-piskarov opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine Ruslan Piskarov Kiev, Ukraine
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Composer require failure
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    4 pass, 4 fail
  • πŸ‡«πŸ‡·France dydave

    Hi Ruslan (@Ruslan Piskarov),

    Thank you very much for raising this issue and for contributing a patch, it's greatly appreciated.

    Just a quick comment to mention this ticket seems to be related to ✨ New fields added to the menu cannot be exported Needs review where a more generic approach is suggested for supporting in structure_sync import/export of any additional data added by other modules, whether contrib or custom, to Menu Link content items.

    Since Layout Builder isn't really a required core module and structure_sync doesn't really require it, there would be many cases where this config key wouldn't necessarily have any use, thus making this patch and config key 'layout_builder__layout' a bit unnecessary/useless.
    Therefore, we could perhaps suggest implementing this feature in an additional sub-module, with a depency on drupal:layout_builder, with implementations of the hooks added in the patch from the related issue with an example of a custom implementation for menu_link_attributes at #2980893-13: New fields added to the menu cannot be exported β†’ .

    However, this would certainly depend on the way maintainers choose the module should evolve, reviews/feedback on adding additional hooks ( #2980893 ✨ New fields added to the menu cannot be exported Needs review ), before really being able to take this feature any further.

    Otherwise, in terms of code, it could be something like adding sub-module structure_sync:structure_sync_layout_builder which could store implementations of added hooks to import/export the necessary config key 'layout_builder__layout' (in structure_sync_layout_builder.module) and perhaps a config schema file with its type definition for the structure_sync.data config validation.

    Not sure if this alternative solution would make sense to you, but in any case, we would greatly appreciate if you could please try testing the suggested patch (!MR20), give us your reviews and opinions on the approach taken in this related ticket ✨ New fields added to the menu cannot be exported Needs review .

    Feel free to let us know at any point if you have any questions or concerns on any aspects of that patch, this reply or the ticket in general, we would surely be very happy to help.
    Thanks again very much for all your code contributions and in advance for your feedback.

Production build 0.71.5 2024