Static and dynamic pages

Static and dynamic pages

"Dynamic" means two different things in 3B Portals, and it helps to separate them before building. A single page can be static or dynamic on each axis independently.

Axis Static Dynamic
Record data (merge tags) The page renders the same for everyone The page fills in live Salesforce data per record
Sub template embedding An embedded fragment is a frozen copy An embedded fragment is pulled live on every render

There is no "dynamic" flag on the Page record. A page is dynamic purely because of what its saved HTML contains. Both mechanisms are described below with how-to steps.

First, what a page actually stores

A Page__c record stores only metadata: title, portal, guest access, caching, and the sub template flag. The page content (HTML, CSS, JS) is not in a field; it is saved as two compressed files attached to the record. So "static vs dynamic" is a property of the saved markup, not a setting on the object. See Web portals and pages and the Object model.

Axis 1: static vs record driven pages (merge tags)

What makes a page record driven

A page is record driven when its HTML contains merge tags. At runtime the engine parses the markup, discovers exactly which fields and child relationships are referenced, queries only those against the current record, substitutes them, and renders. A page with no merge tags skips the data fetch entirely and renders as plain static HTML.

The current record is chosen at runtime: the recordId URL parameter if present, otherwise the logged in Contact. The bound object is implicit: it is whatever that record id points to. There is no per page "data source object" to configure.

How to build a static page

Just design it. Drop in layout, text, images, and components, style it, and save. With no merge tags, it renders identically for every visitor. Good for landing pages, marketing content, and information pages.

How to build a record driven page

  1. Design the page as normal.
  2. Add merge tags where you want live data, for example {{record.FirstName}} or {{record.Account.Name}}. Type them into text or into a component trait in the properties panel.
  3. For lists over child records, wrap a section in a loop: {{#record.Cases}} ... {{/record.Cases}}. Add optional {{! sort: ... }} and {{! filter: ... }} directives immediately before the loop.
  4. Save. The runtime queries only the referenced fields, so adding a tag is all it takes to make a field available.

The full merge tag syntax, loops, sort and filter directives, and how data is fetched are documented in Merge tags and dynamic data.

How to open a record driven page

Point at a record with the recordId parameter:

https://<site>/b3p__Portal#<PageName>?recordId=<id>&sessionKey=<token>

Without a recordId, the page binds to the logged in Contact, so {{record.Field}} refers to the current user's Contact.

Previewing record driven pages in the builder

Set Emulated_Contact__c on the Web Portal record. The builder Preview then renders as that Contact, so merge tags resolve against real data. The AI copilot can also help author merge tags once you pick a context object. This choice is only an authoring and preview aid; the true runtime object still comes from the URL record id. See The AI page builder.

Record driven pages pair with conditional display. Because merge runs before conditional display, hide-if conditions can reference substituted values (for example hide an empty state when a list has records). See Conditional display.

Axis 2: dynamic vs static sub templates (embedding)

A sub template is a page you embed inside other pages. Shared headers, footers, and navigation are the common case. The builder lets you embed it two ways, and this is the toggle literally labelled Dynamic vs Static.

Make a page embeddable

Check Sub_Template__c on the source Page record. It then appears in the sub template picker in the builder.

Embed it

  1. In the target page, drag in the Sub Template block.
  2. In the Configure Sub-Template dialog, pick the source page from the dropdown.
  3. Choose the insertion mode:
    • Dynamic: "updates everywhere automatically." The builder inserts a lightweight placeholder that references the source page by id. Nothing is copied.
    • Static: "one-time copy of current layout." The builder copies the source page's components inline, frozen at insert time.
  4. Save.

What happens at runtime

Dynamic sub templates are the recommended pattern for shared chrome such as navigation bars. See Web portals and pages for the render order.

Putting both axes together

A dynamic navigation bar (Axis 2 dynamic) can itself contain merge tags (Axis 1) such as the logged in user's name, and be embedded into a record driven detail page. On render the runtime injects the dynamic sub template first, then substitutes all merge tags across the combined markup, then applies conditional display, so everything resolves against the same record context in one pass.