> For the complete documentation index, see [llms.txt](https://docs.webstudio.is/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webstudio.is/university/integrations/flotiq.md).

# How to integrate Flotiq with Webstudio

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

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:

* **Flotiq account** – [Register here](https://flotiq.com).
* **Flotiq API Key** – Learn more about [Flotiq API Keys](https://flotiq.com/docs).
* **Webstudio account** – [Sign up here](https://webstudio.is).

{% 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`.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-97058bfa462099a0a8b7e34b4b6026ee54af9a6d%2Fflotiq-create-content-type.png?alt=media" alt="Create content type in Flotiq"><figcaption></figcaption></figure>

### **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](https://docs.webstudio.is/university/foundations/cms.md) 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 **Page settings > Path**, use a parameter to represent the dynamic part of the URL, such as the slug of your blog posts.

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-8a088a8c1397ec5d1f43eb4e39260122a0312ddb%2Fflotiq-dynamic-page-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-61aaf3a8e6d60cb8f5d2b11fcbc2c89f5669fbc6%2Fflotiq-dynamic-page-light.png?alt=media" alt="Page settings with a dynamic path of /screenshot-demos-content/:slug" width="690"></picture><figcaption></figcaption></figure>

In the [Address Bar](https://docs.webstudio.is/university/foundations/cms.md#address-bar), provide a test value.

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-d125565d328df62f24d9cbaa3d288ed6a8f0d9b5%2Fflotiq-dynamic-path-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-7f9e9056ad478eee7fa63817d5fa6035ee712da5%2Fflotiq-dynamic-path-light.png?alt=media" alt="Address popup with hello-world entered as the dynamic slug" width="620"></picture><figcaption></figcaption></figure>

### **Add a GraphQL Data Variable**

[GraphQL data variables](https://docs.webstudio.is/university/foundations/variables.md#graphql) fetch external content.

Select **Body** in the Navigator, then use the **Variables** section in the Settings panel to add a GraphQL Resource.

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:

  ```graphql
  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:

  ```json
  {
    "slug": system.params.slug
  }
  ```

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

<figure><picture><source srcset="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-2da8dc9fcd19017dbc80b4cb48b80f346148c6e3%2Fflotiq-data-variable-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-74a06608de2be46030177bb675c2ca6b377b8c71%2Fflotiq-data-variable-light.png?alt=media" alt="GraphQL variable with Flotiq query, dynamic slug, and example API key placeholder" width="322"></picture><figcaption></figcaption></figure>

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

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-49144098932c70c3e6d64d03a8f46bc32589356a%2Fflotiq-inspect-tool.png?alt=media" alt="Browser developer tools showing the Flotiq API response structure"><figcaption></figcaption></figure>

### **Bind Flotiq data to your page**

Once your Flotiq data is fetched, you can [bind](https://docs.webstudio.is/university/foundations/cms.md#binding-data) 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](https://docs.webstudio.is/university/foundations/expression-editor.md) 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 %}

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-72cca465a6df56d55460906ed98a762e31900a02%2Fflotiq-bind-data.gif?alt=media" alt="Binding Flotiq response data to an instance in Webstudio"><figcaption></figcaption></figure>

### **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`:

```graphql
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](https://docs.webstudio.is/university/core-components/collection.md):\
  `<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.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-8552db6369a9a09a97d373a4abdef2b6ed84295f%2Fflotiq-listing-page.gif?alt=media" alt="Create overwiev page"><figcaption></figcaption></figure>

## 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.

## Related

* [CMS](https://docs.webstudio.is/university/foundations/cms.md) – Learn about dynamic pages and Resources in Webstudio
* [Variables](https://docs.webstudio.is/university/foundations/variables.md) – Understand GraphQL Resource variables
* [Collection](https://docs.webstudio.is/university/core-components/collection.md) – Display multiple records from your CMS
* [Hygraph Integration](https://docs.webstudio.is/university/integrations/hygraph.md) – Another GraphQL-based headless CMS
* [WordPress Integration](https://docs.webstudio.is/university/integrations/wordpress.md) – Build a frontend for headless WordPress


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.webstudio.is/university/integrations/flotiq.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
