Skip to main content
The Frontend Template Engine is a client-side processor that runs in the visitor’s browser. It lets you build HTML that reacts to data (cart items, checkout totals, URL parameters, etc.) and updates when that data changes—without a full page reload.
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.
The frontend engine is the last of four layers that rewrite a page, and it is the only one that runs in the browser. Split-test and dynamic containers were already filled on the server, before this engine existed — so a <template-if> wrapped around a container does not stop the container from being filled. Read Rendering pipeline before mixing layers.

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.
If the content is the same for everyone and does not change after load (e.g. a fixed headline), use normal content or page variables instead.

How it works

  1. Data lives in window.efScope — The app (and cart/checkout plugins) put data here: cartItems, checkout, query, etc.
  2. You use custom tags and expressions<template-if>, <template-foreach>, [[ path ]], ef-text, @click, and similar.
  3. Scope changes update automaticallywindow.efScope is reactive. Changing values (including nested values and arrays) re-evaluates conditions, re-renders loops, and refreshes bindings.
There is no virtual DOM; reactivity is scope- and event-driven with automatic change detection.

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 the wrong branch. On ElasticFunnels-hosted pages the platform already ships this stylesheet in <head>: it hides [data-ef-cloak] plus every engine tag — template-if, template-else-if, template-if-else, template-else, template-foreach, template-vars, template-set, template-partial / partial. If you embed the engine elsewhere, hide the full list; a tag left out of it paints its raw content on first paint and then disappears.
On offer/checkout pages, the application and plugins (cart, checkout, bumps) usually manage efScope for you.

What the engine provides

Builder-friendly bindings

For page-builder work, attribute bindings are often easier to preview and edit than mixed text tokens:
You can add these directly from the Data Attributes panel (right sidebar) when a component is selected. Details and examples are in Syntax, Scope & Data, Bindings & Events, Functions, Cart, and Checkout.

Relation to other docs

  • Frontend Template Engine (this section) — Full reference: syntax, scope, bindings, cart, checkout, limitations, debugging.
  • Backend Template Engine — Documented in Backend Template Engine (server-side {{ }}, @if, @foreach, etc.).
Next: Syntax.