This documentation covers the frontend template system only. A separate backend Template Engine (server-side) uses different syntax (e.g.
{{ }}, @if, @foreach). You can use both on the same page: backend for initial render, frontend for live updates.When to use it
Use the frontend template engine when:- Content depends on the visitor — Cart items, item count, order total, selected bumps, coupon status.
- You want live updates — Adding to cart, changing quantity, applying a coupon, or toggling bumps should update the UI immediately.
- You control the layout — You design the structure (rows, labels, buttons) in the page builder; only the data is dynamic.
How it works
- Data lives in
window.efScope— The app (and cart/checkout plugins) put data here:cartItems,checkout,query, etc. - You use custom tags and expressions —
<template-if>,<template-foreach>,[[ path ]],ef-text,@click, and similar. - Scope changes update automatically —
window.efScopeis reactive. Changing values (including nested values and arrays) re-evaluates conditions, re-renders loops, and refreshes bindings.
Quick start
1. Put reactive data in window.efScope
2. Use custom tags and expressions in your HTML
3. Change scope directly (auto reactive)
data-ef-cloak— Hides the element until the template processor has run (removes the attribute when done). Use it to avoid a flash of raw[[ ... ]]or wrong branch. The app should include CSS that hides[data-ef-cloak](e.g.[data-ef-cloak] { display: none !important; }) and optionally the template custom elements (template-foreach, template-if, template-else, template-set) until processed.
efScope for you.
What the engine provides
| Feature | Purpose |
|---|---|
[[ expression ]] | Insert a value (or expression) in text or attributes. |
<template-if> / <template-else-if> / <template-else> | Show one block based on a condition. |
<template-foreach> | Repeat a block once per item in an array. |
ef-text / ef-html | Bind an element’s text or HTML to an expression (data- aliases also supported). |
ef-href / ef-title / ef-alt / ef-placeholder | One-way attribute bindings from scope to DOM attributes. |
ef-value / data-template-value | Two-way form binding (Vue v-model style) for inputs, selects, textareas. |
@click (and other events) | Run an expression when the user clicks (or triggers another event). |
:checked / :disabled / :value | One-way bindings from scope to DOM properties. |
| Built-in functions | formatPrice, cartCount, cartSubtotal, upper, lower, titleCase, etc. |
ef.template.watch/computed | Runtime API for watchers and computed values via window.ef.template. |
Builder-friendly bindings
For page-builder work, attribute bindings are often easier to preview and edit than mixed text tokens:Relation to other docs
- Frontend Templates — High-level guide for using templates in the page builder (variables, loops).
- Frontend Template Engine (this section) — Full reference: syntax, scope, bindings, cart, checkout, limitations, debugging.
- Backend Template Engine — Documented separately (server-side
{{ }}and tags).