On this page
Component imports reference
Import HTML fragments and complete theme pages.
Before you begin: Loading attributes reference.
Component Imports
Use imports to keep repeated HTML in small theme components without writing layout helper JavaScript.
f-insert keeps the host element and places the imported HTML inside it. f-replace swaps the host element out completely.
Imported fragments can contain normal FQL markup:
Frontbacked resolves imports before the browser receives the page, so shared components are already in place. Imported f-text, f-attr-*, f-list, and event-bound state sources work like markup written directly on the page.
Import paths are same-theme HTML paths only. URLs, .., hidden files, backend, skins, uploads, and node_modules are blocked. Nested imports are resolved by Frontbacked with depth and size limits plus recursion detection.
Importing Full Pages
An imported file may be a full HTML document:
When a full page is imported, only the imported page's <body> content is inserted. The imported <head> is not inserted, so titles, meta tags, styles, and scripts from the imported page do not leak into the parent page.
The exception is the imported page's {STATE} comment. Frontbacked merges imported head state into the parent page's single {STATE} comment before serving the HTML:
The final page sent to the browser has one head state declaration that contains both imported state and parent page state. Parent page state is added last, so a duplicate key on the parent page overrides the imported key.
If an import fails or a circular import is detected, the placeholder is replaced with a visible frontbacked-import-error block. Valid sibling imports still render.
Continue with Page functions reference.