@@ -31,14 +31,13 @@ public function __construct(StyleExtractorInterface $styleExtractor)
31
31
public function render (array $ itemData , array $ additionalData = []) : string
32
32
{
33
33
$ formData = $ itemData ['formData ' ] ?? [];
34
- $ appearance = (isset ($ formData ['template ' ])
35
- && $ formData ['template ' ] === 'full-width.phtml ' ) ? 'full-width ' : 'contained ' ;
36
34
37
35
$ style = $ this ->styleExtractor ->extractStyle ($ formData );
38
36
39
37
$ childrenHtml = (isset ($ additionalData ['children ' ]) ? $ additionalData ['children ' ] : '' );
40
38
41
- if ($ appearance === 'full-width ' ) {
39
+ // Return an altered appearance for full width
40
+ if (isset ($ formData ['template ' ]) && $ formData ['template ' ] === 'full-width.phtml ' ) {
42
41
return $ this ->renderElementWithAttributes (
43
42
[
44
43
'data-element ' => 'main ' ,
@@ -57,25 +56,22 @@ public function render(array $itemData, array $additionalData = []) : string
57
56
);
58
57
}
59
58
60
- if ($ appearance === 'contained ' ) {
61
- return $ this ->renderElementWithAttributes (
59
+ // All other rows default to our new default of contained
60
+ return $ this ->renderElementWithAttributes (
61
+ [
62
+ 'data-element ' => 'main ' ,
63
+ 'data-role ' => 'row ' ,
64
+ 'data-appearance ' => 'contained ' ,
65
+ ],
66
+ $ this ->renderElementWithAttributes (
62
67
[
63
- 'data-element ' => 'main ' ,
64
- 'data-role ' => ' row ' ,
65
- 'data-appearance ' => ' contained ' ,
68
+ 'data-element ' => 'inner ' ,
69
+ 'class ' => $ itemData [ ' formData ' ][ ' css_classes ' ] ?? ' ' ,
70
+ 'style ' => $ style ?? null
66
71
],
67
- $ this ->renderElementWithAttributes (
68
- [
69
- 'data-element ' => 'inner ' ,
70
- 'class ' => $ itemData ['formData ' ]['css_classes ' ] ?? '' ,
71
- 'style ' => $ style ?? null
72
- ],
73
- $ childrenHtml
74
- )
75
- );
76
- }
77
-
78
- return '' ;
72
+ $ childrenHtml
73
+ )
74
+ );
79
75
}
80
76
81
77
/**
0 commit comments