Files
webstudio/docs/university/integrations/flotiq.md
Oleg Isonen 1b48716ff4 docs: Document MDX-backed Content Blocks (#6273)
## Summary

- Document how people create, connect, edit, validate, and publish
MDX-backed Content Blocks.
- Document the complete MCP workflow, including scoped expression
sources, frontmatter updates, diagnostics, conflicts, and disconnect
behavior.
- Add two focused screenshots for the human workflow.
- Fix issues found by a low-reasoning MCP agent while executing every
documented workflow.

Ref #6182

## Implementation notes

- Connection confirmation uses the public `confirmReplacement` field
because `confirm` is reserved as a hidden transport field.
- MCP edits frontmatter with `update-content-block-frontmatter`;
materialized MDX elements are not persistent targets for generic
instance mutation tools.
- Reload now intentionally discards a conflicted local source and
accepts the Asset's latest storage revision before an edit is reapplied.
- Generated MCP documentation and runtime contracts are updated from
their source files.

## Checklist

- [x] Document the human MDX Content Block workflow.
- [x] Document MCP discovery, connection, editing, diagnostics,
frontmatter, dynamic sources, conflicts, and disconnection.
- [x] Add only screenshots that clarify otherwise hard-to-describe UI
steps.
- [x] Test every documented MDX capability through the local MCP CLI
with a low-reasoning agent.
- [x] Reproduce and fix the replacement-confirmation schema mismatch.
- [x] Reproduce and fix persistent-session conflict reload and reapply.
- [x] Add regression tests that failed before each product fix and pass
afterward.
- [x] Regenerate runtime contracts and generated MCP documentation.
- [x] Review authoritative `docs/` content and update affected pages.
- [x] Run affected tests, typechecks, formatting, and diff checks.

## Verification

- Project Build: 208 affected tests passed.
- Content Engine Asset session: 8 tests passed.
- CLI documentation tests: 14 tests passed.
- MCP docs generator: 3 tests passed.
- Content Engine, Project Build, CLI, and MCP docs typechecks passed.
- `pnpm oxfmt --check` passed.
- `git diff --check` passed.
- Low-reasoning MCP evaluation passed all documented workflows,
including a real two-client revision conflict, reload, reapply, and
final saved inspection.
2026-08-31 18:39:05 +02:00

6.4 KiB
Raw Permalink Blame History

description
description
Learn how to integrate Flotiq with Webstudio to build dynamic, content-driven websites—visually.

How to integrate Flotiq with Webstudio

This guide demonstrates how to integrate Flotiq with Webstudio to build a fully dynamic, content-driven website.

What is Flotiq?

Flotiq is a headless CMS designed to make content management simple and powerful. It allows you to create, manage, and deliver content through APIs, offering flexibility and scalability.

Paired with Webstudio, you can design dynamic frontends while keeping content stored and managed in Flotiq.

Prerequisites

Before starting, ensure you have the following:

{% hint style="info" %}

Webstudio’s Pro tier plan is required to use the Resource feature. Flotiq does not require a paid plan. {% endhint %}

1. Setting up Flotiq

Create a content type

Start by creating a content type in Flotiq. For this tutorial, we’ll use Flotiq’s Blogpost Template, which includes fields like title, slug, excerpt, content, and headerImage.

Create content type in Flotiq

Add sample data

Populate your content type with a few example blog posts to test your integration.

2. Setting Up Webstudio

Create a new project

  1. Log in to Webstudio and either create a new project or edit an existing one.
  2. Choose a template or start with a blank project.

Create a Dynamic Page

Dynamic pages in Webstudio allow you to create a single template that dynamically changes based on the currently viewed URL.

To create a page with a dynamic path, go to Pages > Add New Page. In the Dynamic Path field, use a parameter to represent the dynamic part of the URL, such as the slug of your blog posts.

Create a Page with a Dynamic Path

In the Address Bar, provide a test value.

Set the dynamic path

Add a GraphQL Data Variable

GraphQL data variables fetch external content.

Go to Page Settings > Data variables > Add New Variable.

Next, configure the variable:

  • Name: A custom name for the variable.

  • Type: Use GraphQL for this integration.

  • URL: Set to https://api.flotiq.com/api/graphql.

  • Headers: Add a header with X-Auth-Token as the key and your Flotiq API Key as the value.

  • Query: Use a GraphQL query to fetch data. Here’s an example for the Blogpost template:

    query Post($slug: String = "") {
      blogpost(field: "slug", value: $slug) {
        id
        title
        slug
        excerpt
        headerImage {
            alt
            url
        }
      }
    }
    
  • GraphQL Variables: Bind the slug from the dynamic path:

    {
      "slug": system.params.slug
    }
    

The variable should be configured as shown in the screenshot below:

Configure a data variable

Test the variable - if it is configured correctly, the fetched Flotiq content will appear in the Inspect Tool.

Browser developer tools showing the Flotiq API response structure

Bind Flotiq data to your page

Once your Flotiq data is fetched, you can bind it to your components and page settings.

Bind data to components

Add components such as headings or images to your page.

To bind data:

  • Select a component and navigate to its settings.
  • Click the "+" button next to the desired property (e.g., Text Content).
  • Open the Expression editor and map values from your Flotiq data variable, for example, VariableName.data.data.blogpost.title.

{% hint style="info" %}

For images add an Image Component, and bind the Source Property to the image URL: "https://api.flotiq.com/" + VariableName.data.data.blogpost.headerImage[0].url. {% endhint %}

Binding Flotiq response data to an instance in Webstudio

Create a listing page

Showcase multiple content items, like blog posts or portfolio entries, on a single page by fetching and displaying a list of data.

Add a new Data Variable

This variable will fetch a list of all objects from your Flotiq content type. Example query for BlogpostList:

query Posts {
 blogpostList {
   id
   title
   slug
   excerpt
   headerImage {
       alt
       url
   }
 }
}

Add a collection component

  • Bind the list (array) of items from the Data Variable to the collection:
    <Data Variable Name>.data.data.<Content Type API Name>List.
  • The collection component iterates over each item and replicates your design. Bind the collectionItem to get the current iteration's data.

Customize the collection

Add components to the collection item (e.g., cards with titles, excerpts, and images). Editing one item applies the same layout to all items.

Create overwiev page

Conclusion

Now you should have your content from Flotiq displayed on Webstudio on both a listing page and a dynamic page that changes depending on the slug viewed.