Advanced menu with Flex Layout
✨ Branch: menuflex
Introduction
As we've seen in the last step, a Submenu accepts any Store Framework block as child.
With this in mind, we can improve the previous activity's Menu configuration, adding to its content by using Flex Layout.
Activity
According to what we did in the last activity and what was learned about Flex Layout, let's apply Flex Layout to the Major Appliances submenu.
-
In the menu.jsonc file, remove the block of code in which you define vtex.menu@2.x:submenu#major and also its children:
"vtex.menu@2.x:submenu#major": {
"children":[ "vtex.menu@2.x:menu#major" ]
},
"vtex.menu@2.x:menu#major": {
"children": [
"menu-item#refrigerators",
"menu-item#ovens",
"menu-item#washers"
],
"props": {
"orientation": "vertical"
}
},
-
Create the menu-flex.jsonc file; flex-layout.row#major will be in the children list pertaining to the vtex.menu@2.x:submenu#major block and it's defined as:
{
...
"flex-layout.row#major": {
"children": [
"flex-layout.col#menu",
"flex-layout.col#img"
]
},
...
}
-
Now, let's declare the blocks defined in flex-layout.row#major. To start, declare the flex-layout.col#menu block, having vtex.menu@2.x:menu#major as child;
-
Do the same for the flex-layout.col#img block, declaring image#menu and rich-text#header as its children, in addition to the following props:
...
"props":{
"paddingRight": 4,
"horizontalAlign": "right"
}
...
-
Lastly, let's declare the former image#menu as child in this last step, using the code below:
...
"image#menu": {
"props": {
"src": "https://appliancetheme.vteximg.com.br/arquivos/menu-washer.jpg",
"link": {
"url": "/small-appliances/coffee-makers"
},
"alt": "Coffee Makers Collection",
"maxWidth": "200px"
}
}
ℹ️ Remember to access the documentation of both Flex Layout and Menu if you have any questions during the activity.
Expected result:

If you're still unsure as to how to send your answers, click here.
Advanced menu with Flex Layout
✨ Branch: menuflex
Introduction
As we've seen in the last step, a Submenu accepts any Store Framework block as child.
With this in mind, we can improve the previous activity's Menu configuration, adding to its content by using Flex Layout.
Activity
According to what we did in the last activity and what was learned about Flex Layout, let's apply Flex Layout to the Major Appliances submenu.
In the
menu.jsoncfile, remove the block of code in which you definevtex.menu@2.x:submenu#majorand also its children:Create the
menu-flex.jsoncfile;flex-layout.row#majorwill be in the children list pertaining to thevtex.menu@2.x:submenu#majorblock and it's defined as:{ ... "flex-layout.row#major": { "children": [ "flex-layout.col#menu", "flex-layout.col#img" ] }, ... }Now, let's declare the blocks defined in
flex-layout.row#major. To start, declare theflex-layout.col#menublock, havingvtex.menu@2.x:menu#majoras child;Do the same for the
flex-layout.col#imgblock, declaringimage#menuandrich-text#headeras its children, in addition to the following props:Lastly, let's declare the former
image#menuas child in this last step, using the code below:ℹ️ Remember to access the documentation of both Flex Layout and Menu if you have any questions during the activity.
Expected result:

If you're still unsure as to how to send your answers, click here.