DocsQueries & lists · FQL
On this page

Read page data

Read URL values, site information and settings.

FQL lets your page ask for the data it needs directly from the markup. When expressions reference settings, posts, transactions, wallet balances, aggregates, or lists, Frontbacked loads the missing data and re-renders the page state for you.

Data Roots

RootPurpose
$queryBrowser URL query string values.
$paramsServer-provided route params from window.$params.
$siteInfoServer-provided site information from window.$siteInfo.
$authThe current signed-in user, fetched when needed.
$currencyThe storefront currency context selected by the site owner or visitor.
$walletThe signed-in user's wallet balances, including $wallet.default for the platform currency.
$editModePage edit-mode status, including active, canEnable, and whether the browser has accepted the edit-mode warning.
$settingsSite/theme settings fetched from Frontbacked.
bare post typeA single post lookup, such as articles{id:$query.id}.
$posts or $postA single post lookup with an explicit post root, such as $posts.articles{id:$query.id}.
$transactionsCurrent user's site transaction records and aggregates.
$listA list query declared in state.
$stateCurrent browser state.
$Current item inside an f-list template.

Query String

For a URL like /signup?plan=pro&ref=partner, use $query.

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

Route Params and Site Info

Frontbacked makes route params and public site info available to your page. Route params usually come from backend/paths.json; see Theme Routing for the full routing file format.

index.html

Use them in FQL:

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

$siteInfo can include public contact fields selected by the site admin: email, phone, businessAddress, whatsappContact, telegramContact, and socialProfiles. Social profiles use stable platform keys such as instagram, facebook, x, tiktok, youtube, linkedin, whatsapp, telegram, and pinterest. Frontbacked normalizes handles and returns a generated url when the platform can safely build one. Theme code should show a social profile only when profile.url exists, and can map profile.platform to its preferred icon library.

$siteInfo.name returns the first word of the site name, ideal for compact logos and navigation. $siteInfo.fullname returns the complete site name for headings, footers, and other places with room for it. A one-word site name is returned unchanged by both attributes. Words are separated by whitespace; leading and trailing whitespace is removed, while capitalization and punctuation are preserved.

Site name$siteInfo.name$siteInfo.fullname
AcmeAcmeAcme
Acme CapitalAcmeAcme Capital
Acme Capital GroupAcmeAcme Capital Group

Both attributes are absent when no non-empty site name is configured, so use a fallback where needed.

Settings

Use $settings for site or theme settings.

FQL state configuration

Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →

When a referenced setting path is missing locally, Frontbacked requests it.

Continue with Read a saved record.