@@ -60,11 +60,10 @@ public function render(array $itemData, array $additionalData = []) : string
60
60
$ eavData = $ this ->eavAttributeLoader ->load ($ itemData ['entityId ' ]);
61
61
62
62
$ rootElementAttributes = [
63
- 'data-element ' => 'main ' ,
64
- 'data-role ' => 'html ' ,
65
- 'data-appearance ' => 'default ' ,
66
- 'class ' => $ eavData ['css_classes ' ] ?? ''
63
+ 'data-mage-init ' => $ this ->getMageInitValue ($ itemData ),
64
+ 'class ' => 'pagebuilder-accordion ' . ($ eavData ['css_classes ' ] ?? '' )
67
65
];
66
+
68
67
$ rootElementAttributes ['class ' ] = rtrim ($ rootElementAttributes ['class ' ]);
69
68
70
69
if (isset ($ itemData ['formData ' ])) {
@@ -74,13 +73,15 @@ public function render(array $itemData, array $additionalData = []) : string
74
73
}
75
74
}
76
75
77
- $ rootElementHtml = '<div ' ;
76
+ $ accordionElementHtml = '<div ' ;
78
77
foreach ($ rootElementAttributes as $ attributeName => $ attributeValue ) {
79
- $ rootElementHtml .= $ attributeValue ? " $ attributeName= \"$ attributeValue \"" : '' ;
78
+ $ accordionElementHtml .= $ attributeValue ? " $ attributeName= \"$ attributeValue \"" : '' ;
80
79
}
81
- $ rootElementHtml .= '><div class="pagebuilder-accordion" data-mage-init=" ' . $ this ->getMageInitValue ($ itemData ) . '"> ' .
82
- (isset ($ additionalData ['children ' ]) ? $ additionalData ['children ' ] : '' ) .
83
- '</div></div> ' ;
80
+ $ accordionElementHtml .= '> ' . (isset ($ additionalData ['children ' ]) ? $ additionalData ['children ' ] : '' ) .
81
+ '</div> ' ;
82
+
83
+ $ rootElementHtml = '<div data-element="main" data-role="html" data-appearance="default"> ' ;
84
+ $ rootElementHtml .= $ accordionElementHtml . '</div> ' ;
84
85
85
86
return $ rootElementHtml ;
86
87
}
0 commit comments