Skip to content

Commit 38e9436

Browse files
author
Jerry Lopez
committed
Begin to add attributes
1 parent 637483d commit 38e9436

File tree

1 file changed

+59
-15
lines changed

1 file changed

+59
-15
lines changed

snippets/layout.json

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/xml-instructions.html
66
*
77
*/
8-
9-
"Layout Base": {
10-
"prefix": "m2l-base",
8+
9+
/* Scaffolding */
10+
"Layout Scaffold": {
11+
"prefix": "m2.layout",
1112
"body": [
1213
"<?xml version=\"1.0\"?>",
1314
"<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View/Layout/etc/page_configuration.xsd\">",
@@ -16,17 +17,19 @@
1617
"\t</body>",
1718
"</page>"
1819
],
19-
"description": "Base layout code for every layout file"
20+
"description": "Magento 2 layout scaffold"
2021
},
22+
23+
/* Tags */
2124
"Block": {
22-
"prefix": "m2l-block",
25+
"prefix": "m2.layout.block",
2326
"body": [
2427
"<block class=\"$1\" name=\"$3\" as=\"$5\" template=\"$7\" />$0",
2528
],
2629
"description": "Defines a block"
2730
},
2831
"Block Wrap": {
29-
"prefix": "m2l-block-wrap",
32+
"prefix": "m2.layout.blockWrap",
3033
"body": [
3134
"<block class=\"$1\" name=\"$3\" as=\"$5\" template=\"$7\" />",
3235
"\t$0",
@@ -35,14 +38,14 @@
3538
"description": "Defines a wrapping block"
3639
},
3740
"Container": {
38-
"prefix": "m2l-container",
41+
"prefix": "m2.layout.container",
3942
"body": [
4043
"<container name=\"$1\" label=\"$2\" output=\"${3:0}\" htmlTag=\"$4\" htmlId=\"$5\" htmlClass=\"$6\" />$0"
4144
],
4245
"description": "A structure without content that holds other layout elements such as blocks and containers"
4346
},
4447
"Container Wrap": {
45-
"prefix": "m2l-container-wrap",
48+
"prefix": "m2.layout.containerWrap",
4649
"body": [
4750
"<container name=\"$1\" label=\"$2\" output=\"${3:0}\" htmlTag=\"$4\" htmlId=\"$5\" htmlClass=\"$6\">",
4851
"\t$0",
@@ -51,7 +54,7 @@
5154
"description": "A structure without content that holds other layout elements such as blocks and containers"
5255
},
5356
"Reference Block": {
54-
"prefix": "m2l-refblock",
57+
"prefix": "m2.layout.refBlock",
5558
"body": [
5659
"<referenceBlock name=\"$1\">",
5760
"\t$0",
@@ -60,7 +63,7 @@
6063
"description": "Targets blocks and applies updates specified"
6164
},
6265
"Reference Container": {
63-
"prefix": "m2l-refcontainer",
66+
"prefix": "m2.layout.refContainer",
6467
"body": [
6568
"<referenceContainer name=\"$1\">",
6669
"\t$0",
@@ -69,28 +72,28 @@
6972
"description": "Targets containers and applies updates specified"
7073
},
7174
"Move": {
72-
"prefix": "m2l-move",
75+
"prefix": "m2.layout.move",
7376
"body": [
7477
"<move element=\"$1\" destination=\"$2\" />$0"
7578
],
7679
"description": "Sets the declared block or container element as a child of another element in the specified order"
7780
},
7881
"Remove": {
79-
"prefix": "m2l-remove",
82+
"prefix": "m2.layout.remove",
8083
"body": [
8184
"<remove src=\"$1\" />$0"
8285
],
8386
"description": "Is used only to remove the static resources linked in a page <head> section"
8487
},
8588
"Update": {
86-
"prefix": "m2l-update",
89+
"prefix": "m2.layout.update",
8790
"body": [
8891
"<update handle=\"$0\"/>"
8992
],
9093
"description": "Includes a certain layout file"
9194
},
9295
"Arguements": {
93-
"prefix": "m2l-args",
96+
"prefix": "m2.layout.args",
9497
"body": [
9598
"<arguments>",
9699
"\t$0",
@@ -99,10 +102,51 @@
99102
"description": "Includes a certain layout file"
100103
},
101104
"Arguement": {
102-
"prefix": "m2l-arg",
105+
"prefix": "m2.layout.arg",
103106
"body": [
104107
"<argument name=\"${1:name}\" xsi:type=\"${2:type|string,boolean,object,number,null,array|}\">$0</argument>",
105108
],
106109
"description": "Includes a certain layout file"
107110
},
111+
112+
/* Attributes */
113+
"Before": {
114+
"prefix": "m2.layout.attr.before",
115+
"body": [
116+
"before=\"${1:|dash(-),element,empty|}\"$0",
117+
],
118+
"description": "Before attribute"
119+
},
120+
121+
"After": {
122+
"prefix": "m2.layout.attr.after",
123+
"body": [
124+
"after=\"${1:|dash(-),element,empty|}\"$0",
125+
],
126+
"description": "After attribute"
127+
},
128+
129+
"Cacheable": {
130+
"prefix": "m2.layout.attr.cacheable",
131+
"body": [
132+
"cacheable=\"${boolean:|true,false|}\"$0",
133+
],
134+
"description": "Cacheable attribute"
135+
},
136+
137+
"Display": {
138+
"prefix": "m2.layout.attr.display",
139+
"body": [
140+
"display=\"${boolean:|true,false|}\"$0",
141+
],
142+
"description": "Display attribute"
143+
},
144+
145+
"Remove Attribute": {
146+
"prefix": "m2.layout.attr.remove",
147+
"body": [
148+
"remove=\"${boolean:|true,false|}\"$0",
149+
],
150+
"description": "Remove attribute"
151+
},
108152
}

0 commit comments

Comments
 (0)