DocsFiles & media
On this page

Set icons and link previews

Choose the site icon and default preview image for shared links.

Before you begin: Set site images and previews.

Upload a logo in Settings → Site identity and Frontbacked supplies browser icons and social sharing images automatically. No theme JavaScript is needed. The first HTML response includes the tags, so crawlers can read them before scripts run.

Admins can also upload a separate Site icon and Sharing image, choose a sharing background, or select Use site logo to return to the default. These uploads save independently of the profile form. Uploading or removing them requires permission to edit site settings.

The defaults include a 32×32 PNG favicon, a 180×180 PNG shortcut icon, and a 1200×630 JPEG sharing image. Images are fitted inside their canvas without cropping the logo. PNG icons preserve transparent padding; the sharing background applies to the JPEG preview. Frontbacked creates requested sizes on demand and reuses them. SVG logos are converted to a reusable raster source for these sizes, while the original SVG remains available as your logo. Replacing an image retires its generated sizes through the same shared-reference protection and retry process as other managed images. Failed saves keep the current image; unsaved uploads receive a grace period before cleanup.

Override defaults in your theme

Tags already present in your page’s <head> take precedence. For example:

index.html

Frontbacked fills missing tags individually. It uses your page title and description for missing sharing titles and descriptions, and uses an authored Open Graph image as the default Twitter image. Supply your own image dimensions and alternative text when overriding the image.

Default canonical and sharing URLs use the current page’s origin and path, excluding query strings and fragments. If query parameters identify distinct public content, declare an explicit canonical URL and og:url for that page. Public FQL bindings can supply crawler-facing titles, descriptions, and overrides in the first HTML response. Missing sharing titles and descriptions use the rendered title and description. See Data Fetching → Public pages and search previews for supported bindings and protected-page behavior.

Themes can read separately uploaded source URLs through $siteInfo.iconUrl and $siteInfo.socialImageUrl. Both are optional; $siteInfo.logoUrl remains the logo source.

Optional upload recovery controls

Add recovery controls anywhere in your theme. They work with uploads for any post type and field; no UI appears automatically. For theme management pages, call showPanel() from your shared admin script after frontbacked:runtime-ready, and bind a button to showDetails(). The Shipping example demonstrates this pattern.

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

hasPending() returns a boolean for the signed-in user's remembered uploads in this browser and upload feedback already loaded by the page. It does not open UI. showPanel() and showDetails() return { ok: true, shown, count }; shown is false when there are no pending uploads. Repeated calls reuse the existing view.

The panel shows progress and opens the details dialog. The dialog lists filenames, destinations, sizes, and progress, with controls to retry, select the original file when needed, or cancel. If the browser has the required local copy, recovery continues without selecting the file again. Feedback uses .live, without polling.

Hide closes the recovery views and stops their feedback subscriptions. Uploads continue in the background. Theme bindings such as an existing .live upload status remain active independently. Call either method again to reopen the current progress. The details dialog locks background scrolling while open.

cancel(sessionId) returns { ok: true, status: "aborted" } on success, or { ok: false, error }. Use the session id from upload progress or Frontbacked.uploads.status(). Cancellation stops the transfer, removes its recovery copy and pending feedback, and deletes its uploaded files. An unfinished replacement keeps the previously saved attachment. If the cancelled file is already attached, Frontbacked removes its post file data through the usual permissions. Files still used elsewhere remain available there.

When one file in a multi-file save is cancelled, the other transfers continue, but the original combined save is stopped. Return to the original form to review and save the remaining changes.