Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page builder template append instead of replace #837

Open
afourmeaux opened this issue Dec 2, 2022 · 2 comments
Open

Page builder template append instead of replace #837

afourmeaux opened this issue Dec 2, 2022 · 2 comments

Comments

@afourmeaux
Copy link

afourmeaux commented Dec 2, 2022

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.

@m2-assistant
Copy link

m2-assistant bot commented Dec 2, 2022

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


@afourmeaux
Copy link
Author

afourmeaux commented Jul 17, 2024

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 () {

@engcom-Hotel engcom-Hotel moved this to Ready for Grooming in Backlog Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Grooming
Development

No branches or pull requests

1 participant