magento2-page-builder
magento2-page-builder copied to clipboard
Page builder template append instead of replace
Description (*)
Applying page builder templates shouldn't be replacing the current content and it would be more useful if it appended the template to the content. For the time being if i want to use a template for a block that's added in a cms page, i need to create a CMS block that wil be displayed in my CMS page by using the "Block" page builder element. That's a lot of steps to use a template in a full page without saving the full page as a template.
Expected behavior (*)
When applying a template, the content is appended after the existing content.
Benefits
Make the page builder template functionality more useful and reduce the number of CMS block created to manage only a row on a CMS page.
Hi @afourmeaux. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
I made a patch to make this happen, it would be cleaner if a confirm popin asked if we wanted to remove the existing content to let the choice to the user, but for me this work for the time being.
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/js/modal/template-manager-modal.js
@@ -41,8 +41,6 @@
*/
applySelected: function (template) {
if (template) {
- // Destroy the old content in the stage
- this.stage.pageBuilder.destroy();
$('body').trigger('processStart');
stageBuilder(this.stage, template).then(function () {