Associating a template with a layout
Tutorial valid only for Legacy CMS Stores.
Your store codes are written in the CMS templates. When the store gains access to Admin, for example, the Home
template is the one that contains the code of the site's homepage.
But let's say you create a new Home2
template and want to display it on the homepage. How does the platform know that it is the Home2
template that should be shown on the homepage, not the Home
template?
To indicate this, you need to associate the desired template with the layout, which is in the site folder structure within Sites and Channels.
This association is made in the layout properties setting. To get there, follow these steps:
- In the VTEX Admin, acesse Storefront > Layout > CMS and click on Sites and channels.
- Click on the website of the store you are editing.
- Click on the root folder (
/
). - Search for the layout you want to edit.
- Click on the Template drop-down. There will be listed the templates configured in HTML Templates.
- Select the template you want to associate with this layout.
- Type
yes
to confirm the change (this step is necessary because this is a critical change for the site, as the page's front-end will be replaced).
