3B Portals pages are dynamic. You bind Salesforce data into page HTML with merge tags, and the runtime substitutes them against the current record before rendering. The templating engine is Mustache, with HTML escaping disabled so rich text and HTML pass through raw.
Use double brace Mustache tags. Record data is rooted at record.:
{{record.FirstName}}
{{record.Account.Name}}
The context record is chosen in this order: the recordId URL parameter, otherwise the logged in contact's id. So {{record.Field}} refers to whatever record the page is opened for.
Also available in the model without the record. prefix:
{{recordId}} the current record id{{sessionKey}} the current session key{{contactUser.Id}}, {{contactUser.FirstName}} and other fields of the logged in contact{{page.Title__c}}, {{portal.Name}} and other page and portal fieldsUse a Mustache section over a child relationship, prefixed record.. The relationship name is the child relationship API name:
{{#record.Cases}}
<div class="card">
<h3>{{Subject}}</h3>
<span>{{Status}}</span>
</div>
{{/record.Cases}}
Inside the section, fields are relative to each child record. Loops can nest, so you can iterate grandchildren inside a child section.
In an org where Portals is installed as a managed package, use the complete namespaced API names for packaged custom relationships and fields. For example:
<!-- {{#record.b3p__Web_Events__r}} -->
<div>{{b3p__Type__c}}: {{b3p__Details__c}}</div>
<!-- {{/record.b3p__Web_Events__r}} -->
When repeating table rows, keep the merge markers inside HTML comments as shown above. Raw Mustache text is not valid directly inside table, thead, tbody, or tr, and an HTML editor may move it away from the rows before the page is published. The merge engine still recognizes markers inside HTML comments.
Control the order and filtering of a repeatable list with Mustache comments placed immediately before the section. A comment starting with sort: sets the order, and one starting with filter: sets a where clause. They attach to the next section:
{{! sort: CreatedDate DESC}}
{{! filter: Status = 'Open'}}
{{#record.Cases}}
{{Subject}}
{{/record.Cases}}
The server reads these directives from the published template. If the same relationship is used more than once on a page, each repeat section is loaded independently and keeps its own sort and filter directives.
The runtime does not blindly query everything. The published template is parsed to discover exactly which fields and relationships are referenced, then only those are queried.
From version 10.3, this happens on the server. The browser sends the page ID, context record ID, and session key. The server resolves the published template, loads the referenced data, merges it, and returns the finished HTML. The published template decides which fields are queried. See Server-side merging.
A legacy browser-side merge remains as an automatic fallback. Switch it off with the Disable Legacy Data Loader Portal setting after pages are verified on 10.3.
Because only referenced fields are queried, adding a merge tag to the page is enough to make that field available; there is no separate field configuration.
Type merge tags directly into text, or into a component trait value in the properties panel. For example the Chart block's Record Id trait defaults to {{contactUser.Id}}, and Screen Flow or custom component parameters can carry {{record.Id}}. The AI builder can also insert merge tags for you once you pick a context object. See The page builder and The AI page builder.
When a page renders, the runtime processes it in this order:
Because merge runs before conditional display, your hide-if conditions can reference already substituted values.
From 10.3, steps 1 and 2 run on the server. Step 3, conditional display, is unchanged and still runs in the browser on the merged output. See Server-side merging.