- Issue created by @agarzola
This module is really useful, but it does not embed a layout per se. Rather, it hardcodes the markup found in the layout’s template into the source of the WYSIWYG field. While —again— this functionality is very helpful, the current implementation has some drawbacks.
I don’t have the skills to accomplish this myself (not efficiently, anyways), so I am opening this issue in hopes that someone has the time, interest, and skills to do this (assuming this improvement is actually desired by maintainers).
I lack the expertise to know for certain how this is accomplished, but I think the solution should include the use of a custom HTML element to represent the layout (e.g. <drupal-layout>
) with any necessary attributes (layout machine name, maybe some options like those discussed in
3225378
✨
Capture all settings used by layouts
Active
), another custom HTML element to represent layout regions (e.g. <drupal-layout-region>
) with any necessary attributes (layout region machine name, maybe region-specific options, if that’s a thing) and the content added by the user in each region, and finally a filter that processes that custom markup, passes all of the relevant data to the layout template, and renders the layout template. This is not unlike the way a media entity is embedded, for example, via a <drupal-entity>
element.
Active
2.1
Code