Magento 2 Magezon Page Builder

kaleske

Active member
XNullUser
Joined
Feb 10, 2019
Messages
367
Reaction score
63
Points
28
NullCash
137
I tried this module with Magento CE 2.4.4 installation was successful but module does not appear. Is it possible to make this version work with Magento 2.4.4?
 

siste

Member
XNullUser
Joined
Aug 9, 2022
Messages
76
Reaction score
0
Points
6
NullCash
0
Excellent this post. Thank you for sharing
 

Jhonwick69

Active member
XNullUser
Joined
Sep 7, 2021
Messages
167
Reaction score
31
Points
28
NullCash
12
thank you for posting. much appreciated
Post automatically merged:

Thank you for sharing,very interesting and usefull module.
 
Last edited:

chernobyl

Member
XNullUser
Joined
Feb 18, 2022
Messages
70
Reaction score
128
Points
18
NullCash
721
Works whit 2.4.5? I will test! Thank you friend!
Post automatically merged:

Works whit 2.4.5? I will test! Thank you friend!

I have some problem to install in 2.4.5 version.
So, I did any updates and works!

app/code/Magezon/Builder/view/base/web/js/services/url.js

Code:
define([
   'jquery',
   'angular',
], function ($, angular) {

   var magezonBuilderUrl = function($rootScope, elementManager) {

       this.getTemplateUrl = function(elem, defaultTemplate) {
            let localName = 'magezon-builder';
            if (typeof elem[0] !== 'undefined' && typeof elem[0]['localName'] !== 'undefined') {
                localName = elem[0]['localName'];
            }
          var templateUrl;
          var matches = localName.match("mgz-element-navigator-(.*)-mgz");
          if (matches) {
             var name = matches[1];
            templateUrl = elementManager.getElement(name).navigatorTemplateUrl;
          } else {
            var matches2 = localName.match("mgz-element-(.*)-mgz");
            if (matches2) {
               var name = matches2[1];
               templateUrl = elementManager.getElement(name).templateUrl;
            } else {
               templateUrl = elem.attr('templateUrl');
               if (!templateUrl) templateUrl = elem.attr('template-url');
               if (!templateUrl) templateUrl = elem.parent().attr('template-url');
               if (!templateUrl) templateUrl = elem.parent().attr('templateUrl');
            }
          }
         if (!templateUrl && defaultTemplate) templateUrl = defaultTemplate;
          return this.getViewFileUrl(templateUrl);
       }

      this.getViewFileUrl = function(file) {
         if (file.indexOf('http') === -1) {
            return $rootScope.builderConfig.viewFileUrl + file;
         } else {
            return file;
         }
      }

      this.getImageUrl = function(file) {
         if (file && (file.indexOf('http:://') === -1 || file.indexOf('https://') === -1)) {
            return $rootScope.builderConfig.mediaUrl + file;
         } else {
            return file;
         }
      }

      this.getUrl = function(url, params) {
         if (url.indexOf('http') === -1) {
            url = $rootScope.builderConfig.baseUrl + url;
         }
         if (params) {
            url += '?' + $.param(params);
         }
         return url;
      }

      this.getFrontendUrl = function(url, params) {
         if (url.indexOf('http') === -1) {
            url = $rootScope.builderConfig.frontend_url + url;
         }
         if (params) {
            url += '?' + $.param(params);
         }
         return url;
      }
   }

   return magezonBuilderUrl;
});

app/code/Magezon/Builder/view/base/web/template/ui/form/element/builder.html

Code:
<textarea class="admin__control-textarea mgz-hidden" data-bind="
    value: value,
    valueUpdate: valueUpdate,
    hasFocus: focused,
    attr: {
        name: inputName,
        'aria-describedby': noticeId,
        placeholder: placeholder,
        id: htmlId,
        disabled: disabled
    }"></textarea>
<div data-bind="html: $data.content"></div>

=))
 
Last edited:

hxcode

Well-known member
Master
Diamond
Elite
Joined
Aug 16, 2020
Messages
3,535
Reaction score
417
Points
83
NullCash
18
thank you for sharing. i will try it.
 

thelx1

New member
XNullUser
Joined
Oct 26, 2022
Messages
9
Reaction score
0
Points
1
NullCash
2
thank you for this, very helpful as i need to update
 

kaleske

Active member
XNullUser
Joined
Feb 10, 2019
Messages
367
Reaction score
63
Points
28
NullCash
137
Works whit 2.4.5? I will test! Thank you friend!
Post automatically merged:



I have some problem to install in 2.4.5 version.
So, I did any updates and works!

app/code/Magezon/Builder/view/base/web/js/services/url.js

Code:
define([
   'jquery',
   'angular',
], function ($, angular) {

   var magezonBuilderUrl = function($rootScope, elementManager) {

       this.getTemplateUrl = function(elem, defaultTemplate) {
            let localName = 'magezon-builder';
            if (typeof elem[0] !== 'undefined' && typeof elem[0]['localName'] !== 'undefined') {
                localName = elem[0]['localName'];
            }
          var templateUrl;
          var matches = localName.match("mgz-element-navigator-(.*)-mgz");
          if (matches) {
             var name = matches[1];
            templateUrl = elementManager.getElement(name).navigatorTemplateUrl;
          } else {
            var matches2 = localName.match("mgz-element-(.*)-mgz");
            if (matches2) {
               var name = matches2[1];
               templateUrl = elementManager.getElement(name).templateUrl;
            } else {
               templateUrl = elem.attr('templateUrl');
               if (!templateUrl) templateUrl = elem.attr('template-url');
               if (!templateUrl) templateUrl = elem.parent().attr('template-url');
               if (!templateUrl) templateUrl = elem.parent().attr('templateUrl');
            }
          }
         if (!templateUrl && defaultTemplate) templateUrl = defaultTemplate;
          return this.getViewFileUrl(templateUrl);
       }

      this.getViewFileUrl = function(file) {
         if (file.indexOf('http') === -1) {
            return $rootScope.builderConfig.viewFileUrl + file;
         } else {
            return file;
         }
      }

      this.getImageUrl = function(file) {
         if (file && (file.indexOf('http:://') === -1 || file.indexOf('https://') === -1)) {
            return $rootScope.builderConfig.mediaUrl + file;
         } else {
            return file;
         }
      }

      this.getUrl = function(url, params) {
         if (url.indexOf('http') === -1) {
            url = $rootScope.builderConfig.baseUrl + url;
         }
         if (params) {
            url += '?' + $.param(params);
         }
         return url;
      }

      this.getFrontendUrl = function(url, params) {
         if (url.indexOf('http') === -1) {
            url = $rootScope.builderConfig.frontend_url + url;
         }
         if (params) {
            url += '?' + $.param(params);
         }
         return url;
      }
   }

   return magezonBuilderUrl;
});

app/code/Magezon/Builder/view/base/web/template/ui/form/element/builder.html

Code:
<textarea class="admin__control-textarea mgz-hidden" data-bind="
    value: value,
    valueUpdate: valueUpdate,
    hasFocus: focused,
    attr: {
        name: inputName,
        'aria-describedby': noticeId,
        placeholder: placeholder,
        id: htmlId,
        disabled: disabled
    }"></textarea>
<div data-bind="html: $data.content"></div>

=))
Hello thank you for this update. Really helped me
 

cltvchannel

Member
XNullUser
Joined
Aug 11, 2022
Messages
163
Reaction score
0
Points
16
NullCash
90
Nice plugin.
Exactly like WP Bakery for Wordpress.
This is great for users without technical skills.
Thank you!
 
Top