1- {# {% dd element.layout %}#}
1+ {% if element ?? false %}
2+ {# {% dd element.layout %}#}
23
3- <h3 >grid-column-start: x, grid-column-end: x, grid-row-start: y, grid-row-end: y</h3 >
4- <div style =" display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;" >
5- <div style =" grid-column: 1 / 2; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
6- <div style =" grid-column: 2 / 3; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
7- <div style =" grid-column: 3 / 4; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
8- <div style =" grid-column: 4 / 5; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
9- <div style =" grid-column: 5 / 6; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
10- <div style =" grid-column: 6 / 7; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
4+ <h3 >grid-column-start: x, grid-column-end: x, grid-row-start: y, grid-row-end: y</h3 >
5+ <div style =" display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;" >
6+ <div style =" grid-column: 1 / 2; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
7+ <div style =" grid-column: 2 / 3; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
8+ <div style =" grid-column: 3 / 4; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
9+ <div style =" grid-column: 4 / 5; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
10+ <div style =" grid-column: 5 / 6; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
11+ <div style =" grid-column: 6 / 7; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
1112
12- <div style =" grid-column: 1 / 2; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
13- <div style =" grid-column: 2 / 3; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
14- <div style =" grid-column: 3 / 4; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
15- <div style =" grid-column: 4 / 5; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
16- <div style =" grid-column: 5 / 6; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
17- <div style =" grid-column: 6 / 7; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
13+ <div style =" grid-column: 1 / 2; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
14+ <div style =" grid-column: 2 / 3; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
15+ <div style =" grid-column: 3 / 4; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
16+ <div style =" grid-column: 4 / 5; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
17+ <div style =" grid-column: 5 / 6; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
18+ <div style =" grid-column: 6 / 7; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
1819
19- <div style =" grid-column: 1 / 2; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
20- <div style =" grid-column: 2 / 3; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
21- <div style =" grid-column: 3 / 4; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
22- <div style =" grid-column: 4 / 5; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
23- <div style =" grid-column: 5 / 6; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
24- <div style =" grid-column: 6 / 7; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
25- {% if not element .layout .empty %}
26- <div style =" grid-column-start: {{ element .layout .gridColumnStart }}; grid-column-end: {{ element .layout .gridColumnEnd }}; grid-row-start: {{ element .layout .gridRowStart }}; grid-row-end: {{ element .layout .gridRowEnd }}; background-color: rgba(14,114,159,0.6);" ></div >
27- {% endif %}
28- </div >
20+ <div style =" grid-column: 1 / 2; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
21+ <div style =" grid-column: 2 / 3; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
22+ <div style =" grid-column: 3 / 4; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
23+ <div style =" grid-column: 4 / 5; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
24+ <div style =" grid-column: 5 / 6; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
25+ <div style =" grid-column: 6 / 7; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
26+ {% if not element .layout .empty %}
27+ <div style =" grid-column-start: {{ element .layout .gridColumnStart }}; grid-column-end: {{ element .layout .gridColumnEnd }}; grid-row-start: {{ element .layout .gridRowStart }}; grid-row-end: {{ element .layout .gridRowEnd }}; background-color: rgba(14,114,159,0.6);" ></div >
28+ {% endif %}
29+ </div >
2930
30- <h3 >grid-column: x / span x, grid-row: y / span y</h3 >
31- <div style =" display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;" >
32- <div style =" grid-column: 1 / 2; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
33- <div style =" grid-column: 2 / 3; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
34- <div style =" grid-column: 3 / 4; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
35- <div style =" grid-column: 4 / 5; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
36- <div style =" grid-column: 5 / 6; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
37- <div style =" grid-column: 6 / 7; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
31+ <h3 >grid-column: x / span x, grid-row: y / span y</h3 >
32+ <div style =" display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;" >
33+ <div style =" grid-column: 1 / 2; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
34+ <div style =" grid-column: 2 / 3; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
35+ <div style =" grid-column: 3 / 4; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
36+ <div style =" grid-column: 4 / 5; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
37+ <div style =" grid-column: 5 / 6; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
38+ <div style =" grid-column: 6 / 7; grid-row: 1 / 2; height: 30px; background-color: #6f777a;" ></div >
3839
39- <div style =" grid-column: 1 / 2; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
40- <div style =" grid-column: 2 / 3; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
41- <div style =" grid-column: 3 / 4; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
42- <div style =" grid-column: 4 / 5; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
43- <div style =" grid-column: 5 / 6; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
44- <div style =" grid-column: 6 / 7; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
40+ <div style =" grid-column: 1 / 2; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
41+ <div style =" grid-column: 2 / 3; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
42+ <div style =" grid-column: 3 / 4; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
43+ <div style =" grid-column: 4 / 5; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
44+ <div style =" grid-column: 5 / 6; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
45+ <div style =" grid-column: 6 / 7; grid-row: 2 / 3; height: 30px; background-color: #6f777a;" ></div >
4546
46- <div style =" grid-column: 1 / 2; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
47- <div style =" grid-column: 2 / 3; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
48- <div style =" grid-column: 3 / 4; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
49- <div style =" grid-column: 4 / 5; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
50- <div style =" grid-column: 5 / 6; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
51- <div style =" grid-column: 6 / 7; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
52- {% if not element .layout .empty %}
53- <div style =" grid-column: {{ element .layout .gridColumnStart }} / span {{ element .layout .gridColumnSpan }}; grid-row: {{ element .layout .gridRowStart }} / span {{ element .layout .gridRowSpan }}; background-color: rgba(14,114,159,0.6);" ></div >
54- {% endif %}
55- </div >
47+ <div style =" grid-column: 1 / 2; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
48+ <div style =" grid-column: 2 / 3; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
49+ <div style =" grid-column: 3 / 4; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
50+ <div style =" grid-column: 4 / 5; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
51+ <div style =" grid-column: 5 / 6; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
52+ <div style =" grid-column: 6 / 7; grid-row: 3 / 4; height: 30px; background-color: #6f777a;" ></div >
53+ {% if not element .layout .empty %}
54+ <div style =" grid-column: {{ element .layout .gridColumnStart }} / span {{ element .layout .gridColumnSpan }}; grid-row: {{ element .layout .gridRowStart }} / span {{ element .layout .gridRowSpan }}; background-color: rgba(14,114,159,0.6);" ></div >
55+ {% endif %}
56+ </div >
5657
57- <hr >
58+ <hr >
5859
59- <p ><b >Value:</b > <code ><pre style =" white-space: pre-wrap;" >{{ element .layout | json_encode }}</pre ></code ></p >
60- <p ><b >Empty:</b > {{ element .layout .empty | json_encode }}</p >
61- {% if not element .layout .empty %}
62- <p ><b >Raw:</b > {{ element .layout .raw }}</p >
63- <p ><b >gridColumnStart:</b > {{ element .layout .gridColumnStart }}</p >
64- <p ><b >gridColumnEnd:</b > {{ element .layout .gridColumnEnd }}</p >
65- <p ><b >gridRowStart:</b > {{ element .layout .gridRowStart }}</p >
66- <p ><b >gridRowEnd:</b > {{ element .layout .gridRowEnd }}</p >
67- <p ><b >gridColumnSpan:</b > {{ element .layout .gridColumnSpan }}</p >
68- <p ><b >gridRowSpan:</b > {{ element .layout .gridRowSpan }}</p >
69- <p ><b >selectedRows:</b > {{ element .layout .selectedRows | json_encode }}</p >
70- <p ><b >selectedColumns:</b > {{ element .layout .selectedColumns | json_encode }}</p >
71- <p ><b >selectedCoordinates:</b > {{ element .layout .selectedCoordinates | json_encode }}</p >
60+ <p ><b >Value:</b > <code ><pre style =" white-space: pre-wrap;" >{{ element .layout | json_encode }}</pre ></code ></p >
61+ <p ><b >Empty:</b > {{ element .layout .empty | json_encode }}</p >
62+ {% if not element .layout .empty %}
63+ <p ><b >Raw:</b > {{ element .layout .raw }}</p >
64+ <p ><b >gridColumnStart:</b > {{ element .layout .gridColumnStart }}</p >
65+ <p ><b >gridColumnEnd:</b > {{ element .layout .gridColumnEnd }}</p >
66+ <p ><b >gridRowStart:</b > {{ element .layout .gridRowStart }}</p >
67+ <p ><b >gridRowEnd:</b > {{ element .layout .gridRowEnd }}</p >
68+ <p ><b >gridColumnSpan:</b > {{ element .layout .gridColumnSpan }}</p >
69+ <p ><b >gridRowSpan:</b > {{ element .layout .gridRowSpan }}</p >
70+ <p ><b >selectedRows:</b > {{ element .layout .selectedRows | json_encode }}</p >
71+ <p ><b >selectedColumns:</b > {{ element .layout .selectedColumns | json_encode }}</p >
72+ <p ><b >selectedCoordinates:</b > {{ element .layout .selectedCoordinates | json_encode }}</p >
7273
73- {% set result = gql(' {
74- entries(type: "products") {
75- ... on products_products_Entry {
76- featuredProducts {
77- __typename
78- }
79- layout {
80- empty
81- gridColumnStart
82- gridColumnEnd
83- gridRowStart
84- gridRowEnd
85- gridColumnSpan
86- gridRowSpan
87- selectedColumns
88- selectedRows
89- selectedCoordinates
74+ {% set result = gql(' {
75+ entries(type: "products") {
76+ ... on products_products_Entry {
77+ featuredProducts {
78+ __typename
79+ }
80+ layout {
81+ empty
82+ gridColumnStart
83+ gridColumnEnd
84+ gridRowStart
85+ gridRowEnd
86+ gridColumnSpan
87+ gridRowSpan
88+ selectedColumns
89+ selectedRows
90+ selectedCoordinates
91+ }
9092 }
9193 }
92- }
93- }' ) %}
94+ }' ) %}
9495
95- <p ><b >GQL Results:</b > {{ result .data .entries [0 ].layout| json_encode }}</p >
96- {% endif %}
96+ <p ><b >GQL Results:</b > {{ result .data .entries [0 ].layout| json_encode }}</p >
97+ {% endif %}
9798
98- {% set columnStartClasses = {
99- 1: ' col-start-1' ,
100- 2: ' col-start-2' ,
101- 3: ' col-start-3' ,
102- 4: ' col-start-4' ,
103- 5: ' col-start-5' ,
104- 6: ' col-start-6' ,
105- } %}
106- {% set columnSpanClasses = {
107- 1: ' col-span-1' ,
108- 2: ' col-span-2' ,
109- 3: ' col-span-3' ,
110- 4: ' col-span-4' ,
111- 5: ' col-span-5' ,
112- 6: ' col-span-6' ,
113- } %}
114- {% set rowStartClasses = {
115- 1: ' row-start-1' ,
116- 2: ' row-start-2' ,
117- 3: ' row-start-3' ,
118- 4: ' row-start-4' ,
119- 5: ' row-start-5' ,
120- 6: ' row-start-6' ,
121- } %}
122- {% set rowSpanClasses = {
123- 1: ' row-span-1' ,
124- 2: ' row-span-2' ,
125- 3: ' row-span-3' ,
126- 4: ' row-span-4' ,
127- 5: ' row-span-5' ,
128- 6: ' row-span-6' ,
129- } %}
99+ {% set columnStartClasses = {
100+ 1: ' col-start-1' ,
101+ 2: ' col-start-2' ,
102+ 3: ' col-start-3' ,
103+ 4: ' col-start-4' ,
104+ 5: ' col-start-5' ,
105+ 6: ' col-start-6' ,
106+ } %}
107+ {% set columnSpanClasses = {
108+ 1: ' col-span-1' ,
109+ 2: ' col-span-2' ,
110+ 3: ' col-span-3' ,
111+ 4: ' col-span-4' ,
112+ 5: ' col-span-5' ,
113+ 6: ' col-span-6' ,
114+ } %}
115+ {% set rowStartClasses = {
116+ 1: ' row-start-1' ,
117+ 2: ' row-start-2' ,
118+ 3: ' row-start-3' ,
119+ 4: ' row-start-4' ,
120+ 5: ' row-start-5' ,
121+ 6: ' row-start-6' ,
122+ } %}
123+ {% set rowSpanClasses = {
124+ 1: ' row-span-1' ,
125+ 2: ' row-span-2' ,
126+ 3: ' row-span-3' ,
127+ 4: ' row-span-4' ,
128+ 5: ' row-span-5' ,
129+ 6: ' row-span-6' ,
130+ } %}
130131
131- {% set myAttributes = {
132- class : [
133- columnStartClasses [element .layout .gridColumnStart ],
134- columnSpanClasses [element .layout .gridColumnSpan ],
135- rowStartClasses [element .layout .gridRowStart ],
136- rowSpanClasses [element .layout .gridRowSpan ],
137- ],
138- } %}
132+ {% set myAttributes = {
133+ class : [
134+ columnStartClasses [element .layout .gridColumnStart ],
135+ columnSpanClasses [element .layout .gridColumnSpan ],
136+ rowStartClasses [element .layout .gridRowStart ],
137+ rowSpanClasses [element .layout .gridRowSpan ],
138+ ],
139+ } %}
139140
140- <div {{ attr(myAttributes ) }}></div >
141+ <div {{ attr(myAttributes ) }}></div >
141142
142- {# Results look like this: <div class="col-start-1 col-span-3 row-start-1 row-span-2"></div> #}
143+ {# Results look like this: <div class="col-start-1 col-span-3 row-start-1 row-span-2"></div> #}
144+ {% else %}
145+ Testing 🏠 homepage!
146+ {% endif %}
0 commit comments