Open github-learning-lab[bot] opened 4 years ago
:x::x::x::x::x:
:x: Request failed with status code 404
:x: Could not find a store.custom#about-us declaration
:x: Could not find a flex-layout.row#about-us
block inside your template
:x: Your code did not match the sample one provided in the instructions for this step
:x: Could not find a /about-us
path declaration
:white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark:
:white_check_mark: Getting the file
:white_check_mark: Declare a store.custom#about-us
template in your about-us.jsonc file
:white_check_mark: Add a flex-layout.row#about-us
to your template
:white_check_mark: Use the sample code provided in the instructions for this step to complete the layout
:white_check_mark: Create a routes.jsonc file and declare a /about-us
path and check your workspace at {workspace}--appliancetheme.myvtex.com/about-us to see the new page :)
Creating custom templates
:sparkles: Branch: custom-template
Introduction
Stores are made up of several different pages, each with a specific content and layout. When creating a store from scratch in VTEX IO, some default pages with preset URLs are already available. Below, we have a list of some of these default pages:
store.home
(Home page)store.product
(Product page)store.search
(Search Results page)store.account
(Client Account page)store.login
(Login page)store.orderplaced
(Order Placed page)But it's also possible for you to create a custom landing page. In this case, you should create a new URL and specific content to display to users that access this path.
Creating a Landing Page
Just a few steps are needed to create a custom landing page:
Template
A template defines the page layout. However, if you want to create a custom page, you will also need to create a new template in your theme.
Let's imagine that you want to create a simple page containing information about your store. Inside the
blocks
folder, you can create a file that would contain the following code, declaring a new template for a custom page,where
{templateName}
must be replaced with the template's identifying name.Then, you should fill in the code with the components needed to create the layout. Below we have an example of such implementation:
Path
Now that a new template with the page layout has been defined in the store theme's code, the next step is to establish the page's page that would lead to this layout.
We must create a
routes.json
file in your theme'sstore
folder. Afterwards, insert the code below,where
{URL}
is the name of the desired path.Activity
Let's create a page containing information about your store, as in the example below:
blocks
folder, create a file calledabout-us.jsonc
;store.custom#about-us
template in this file;flex-layout.row
, use the code in example given above to complete the page layout;store
folder, create a file calledroutes.json
;/about-us
path;{workspace}--appliancetheme.myvtex.com/about-us
to see your new landing page.If you're still unsure as to how to send your answers, click here.