Rendering HTML with Ajax
Lesson 15 of 28 · 15 min
Render Dynamic Components
Stencil allows you to render dynamic components on the fly. For example, note this default code in templates/components/products/quick-view.html.
Take note of this file name, which Handlebars will reference later in this lesson.
To render a different template, you would instead reference that template’s file name.
For example, assume that you want to substitute a custom template that you’ve named: templates/components/products/quicker-view.html.
This next code block is from the Stencil default theme’s /assets/js/theme/global/quick-view.js file.
NOTE: The quicker-view.html statements brought in to reference the new file name.
EXAMPLE:
You should be able to render dynamic components on the fly.