Menu
Feedback
Start here
Tutorials


Tutorials
Layout
How to use Subtemplates
1 min read

Tutorial valid only for Legacy CMS Stores.

Subtemplates are intended for small structures that could be reused in several Page Templates. Subtemplates work as “includes”.

You can create an HTML block that you intend to reuse, and then insert a call inside a Page Template. To create a subtemplate:

  1. In the VTEX Admin, access Storefront > Layout > CMS and go to the Templates de Página > Subtemplates folder.
  2. Click on the Novo Subtemplate option.
  3. Fill in the Nome do Template field.
  4. Paste your code on the XHTML do Template:field.
  5. Then, click on salvar.

In order to reference a Subtemplate inside a page Template, use the syntax below:

<vtex:template id="name-of-the-id" />

Fill in the id attribute with the name given to the subtemplate.

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
How to turn my store's website into a PWA
« Previous
How to use the meta tags control
Next »
Contributors
1
Photo of the contributor
+ 1 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback