Menu
Feedback
Start here
Tutorials


Tutorials
Layout
How to use Subtemplates
How to use Subtemplates

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
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
How to test for layout problems
« Previous
Image compression
Next »
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback