You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The next block that we'll use is the Shelf, on which we display a product collection. This session will show you how to render and configure this shelf on your store's homepage.
Shelf
After a closer look at the Shelf documentation, we see that it's possible to configure which product collection we want to have displayed using either category, specificationFilters or collection props, according to the products added in the catalog.
Other props help to configure how the items are displayed. It's important to remember that the shelf component always requests that product-summary type blocks be part of its composition. Check out the product-summary block's documentation for more info on how it functions.
In home.jsonc, declare a shelf component is the store.home template;
Inside the blocks folder, create a shelf.jsonc file;
In shelf.jsonc, define the shelf block with all the props given in the example above;
Change the maximum number of displayed items to 8
Change the number of items per page to 4
Note: It's important to remember that the product-summary.shelf block is already declared in default.jsonc. Therefore, it wasn't necessary to declare it during this activity.
ℹ️ Remember to access the Shelf's documentation if you have any questions during this activity.
The end result should be similar to the one below:
Troubleshoot
In case you're using your own VTEX account, make sure that the category 1 is functional and active in your environment.
If you're still unsure as to how to send your answers, click here.
The text was updated successfully, but these errors were encountered:
✅ Add a shelf to store.home blocks
✅ Create a shelf.jsonc file
✅ Add the declarations found at this module's text to shelf.jsonc
✅ Update maximum number of products displayed by the Shelf to 8
✅ Update number of products per page to 4
Product shelf
✨ Branch: shelf
Introduction
The next block that we'll use is the Shelf, on which we display a product collection. This session will show you how to render and configure this shelf on your store's homepage.
Shelf
After a closer look at the Shelf documentation, we see that it's possible to configure which product collection we want to have displayed using either
category
,specificationFilters
orcollection
props, according to the products added in the catalog.Other props help to configure how the items are displayed. It's important to remember that the
shelf
component always requests thatproduct-summary
type blocks be part of its composition. Check out the product-summary block's documentation for more info on how it functions.Below, we have a Shelf implementation example:
Activity
home.jsonc
, declare ashelf
component is thestore.home
template;shelf.jsonc
file;shelf.jsonc
, define theshelf
block with all the props given in the example above;8
4
Note: It's important to remember that the
product-summary.shelf
block is already declared indefault.jsonc
. Therefore, it wasn't necessary to declare it during this activity.ℹ️ Remember to access the Shelf's documentation if you have any questions during this activity.
The end result should be similar to the one below:
Troubleshoot
In case you're using your own VTEX account, make sure that the category
1
is functional and active in your environment.If you're still unsure as to how to send your answers, click here.
The text was updated successfully, but these errors were encountered: