On this page
Render editable lists
Repeat content and images from saved page settings.
Before you begin: Render repeated content.
Lists
Use f-list to repeat the first child of an element for each item in a fetched list.
List rules:
- The list root must have an
id. - The first child is used as the template.
- Inside the template,
$points to the current list item. - Nested
f="true"elements inside the template can usef-textandf-attr-*. - Every non-settings item needs a stable
id. When the data uses another identity field, putf-key="expression"on the first-child template.
Frontbacked uses these keys to retain and reorder existing DOM nodes when list data changes. Missing and duplicate keys are reported as FQL errors.
For settings-backed lists, define a state selector whose source points to the settings path:
The first child is the saved-data template. All authored children are shown when no saved settings array exists yet, which makes them useful as defaults or showcase content for a fresh site. Once the site has a saved array, even an empty array, the saved array controls the public render. If the saved array has one item, only one live item is rendered. If the admin clears the list, no live items are rendered.
In edit mode, missing authored defaults are shown as grey restore suggestions when the saved array is shorter than the authored defaults. Each suggestion has a button that adds that default back to the local draft. An empty saved list also shows an Edit List button so the admin can add custom items or restore all theme defaults.
In edit mode, a list whose selector source starts with $settings. is not edited as a raw array. Frontbacked opens a list editor from the fields in the first template, such as $.title, $.body, f-attr-src="$.image", and f-attr-href="$.url", so decorative icons or fixed theme markup can stay in the theme.
Editable images
Bind an image to a settings field to give site admins a thumbnail with Replace image and Reset to default controls:
Inside a settings-backed list, use f-attr-src="$.image". Image resize helpers can stay on the binding, such as $.image.resizeHeroSlideImage(). Nested settings lists work the same way. A video's f-attr-poster can use this image control too; it does not enable video uploads.
Admins see the image preview and its dimensions instead of editing its URL. Upload a JPEG, PNG, WebP, GIF, or AVIF image up to 5 MB and 40 million pixels. Replacements are saved as WebP images; animated inputs use a still frame. Videos, documents, SVG, and other files are not accepted, even if renamed as an image.
The replacement becomes part of the local draft. Use Save draft, then Save in the edit bar to publish it. Reset to default restores the image authored in the theme. Canceling an editor does not change the saved setting.
Image settings accept replacements uploaded for the current site and original images declared by the theme. They do not accept pasted external URLs or generic uploaded files. Text, alternative text, and links keep their usual text controls.
Continue with Add list controls.