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
In the previous step, we looked at creating a custom template. In scenarios involving promotions and commemorative dates, it's quite common to create special landing pages.
Custom searches
We saw that the search deduces what is needed from the given context. On a custom page however, the context doesn't exist and you need to state which query should be performed to get the results. All this is made possible by the search-result-layout.customQuery.
Query schema
The query schema is one of the custom query search result props that allows you to control the search that the landing page should run. To know more the query schema's possibilities, read through its documentation.
Activity
Define a new path (store.custom#landing) in routes.json;
"store.custom#landing": {
"path": "/landing"
}
Create a new file called search-landing.jsonc in the blocks folder;
Create a new custom template entitled store.custom#landing;
Define the image block as one of this template's blocks. This block must have minWidth props of 100% and an image of your choosing.
Repeat the same with search-result-layout.customQuery:
Define the search-result-layout.customQuery block as the querySchema prop that:
Sorts by latest release date;
Hides unavailable items;
Displays a max of 8 items per page;
Uses "Camera" as query.
At this point, you're probably not seeing the block on the landing page. This is due to the fact that we have not add a block to the search-result-layout.customQuery yet. You can do that by adding the following lines:
✅ Getting the files
✅ Code compilation
✅ Define a new route
✅ Define a store.custom block
✅ Use image block on the store.custom blocks and define the banner
✅ Use search-result-layout.customQuery block on the store.custom blocks and define it
✅ Define the customQuery props
Building a custom search landing page
✨ Branch: landing
Introduction
In the previous step, we looked at creating a custom template. In scenarios involving promotions and commemorative dates, it's quite common to create special landing pages.
Custom searches
We saw that the search deduces what is needed from the given context. On a custom page however, the context doesn't exist and you need to state which query should be performed to get the results. All this is made possible by the
search-result-layout.customQuery
.Query schema
The query schema is one of the custom query search result props that allows you to control the search that the landing page should run. To know more the query schema's possibilities, read through its documentation.
Activity
Define a new path (
store.custom#landing
) inroutes.json
;Create a new file called
search-landing.jsonc
in the blocks folder;Create a new custom template entitled
store.custom#landing
;Define the
image
block as one of this template's blocks. This block must haveminWidth
props of 100% and an image of your choosing.Repeat the same with
search-result-layout.customQuery
:Define the
search-result-layout.customQuery
block as the querySchema prop that:🚫 Are you lost?
Is there any problem with this step? What about sending us a feedback? 🙏
Submit feedback
If you're still unsure as to how to send your answers, click here.
The text was updated successfully, but these errors were encountered: