-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Adjusting the search page's layout
✨ Branch: search2
Introduction
In the last step, we've looked at the search page and its main components. We also learned that the search layout works like any other block, with the added benefit of having all the flexibility it can muster. In this step, we'll create some lines and columns to improve the appearance of the created search.
Activity
-
In the
search.jsoncfile, removetotal-products.v2andorder-by.v2fromsearch-result-layout.desktop. -
Replace both with a line that includes the removed blocks:
... "flex-layout.row#top": { "children": [ "total-products.v2", "order-by.v2" ] } ...
-
Remove
search-contentandfilter-navigator.v3fromsearch-result-layout.desktopand create a results line; -
Place two columns in the results line:
{ ... "search-result-layout.desktop": { "children": [ "breadcrumb.search", "search-title.v2", "flex-layout.row#top", "search-fetch-previous", "flex-layout.row#results", "search-fetch-more" ] }, "flex-layout.row#results": { "children": [ "flex-layout.col#filter", "flex-layout.col#search" ] }, ... } -
Set the
filtercolumn'swidthprop to20%. -
In the left column, include
filter-navigator.v3again and, in the right, includesearch-content.
To finish, we'll use the same product summary (product-summary) that we used to display search results on the shelf. -
Define your
search-contentwith thegalleryandnot-foundblocks:{ ... "search-content": { "blocks": ["gallery", "not-found"] } ... } -
Use
product-summary.shelfin the Gallery's props:{ ... "search-content": { "blocks": ["gallery", "not-found"] }, "gallery": { "blocks": ["product-summary.shelf"] } ... } -
In the
product-summary.shelfblock, found indefault.jsonc, includeproduct-summary-sku-selectoraboveproduct-summary-buy-button.
ℹ️ Remember to access the Flex Layout documentation if you have any questions during the activity.
🚫 Are you lost?
Is there any problem with this step? What about sending us a feedback? 🙏
If you're still unsure as to how to send your answers, click here.
