Contentful to FigmaContentful to Figma plugin logo

Plugin for Figma

Streamline Your Workflow with the Contentful to Figma Plugin

January 03, 2023

Introducing the Contentful to Figma Plugin

In this blog post, we'll discuss the new Contentful to Figma plugin and walk you through its setup and usage. This plugin allows you to seamlessly sync data from your Contentful CMS with your Figma designs. It's perfect for generating Open Graph (OG) images for your blog posts, fetching image data from your CMS, and even working with localized content.

Setting Up the Plugin

To use the plugin, first, install it in your Figma workspace.

  1. Open the plugin by clicking on the plugins tab in the menu.

  2. You'll see a settings page where you can input your Contentful API credentials.

  3. You can choose to save your credentials locally, or check the box to allow sharing of the credentials across your team members.

  4. Once you've entered your credentials, click the "Test Connection" button. You should see a "Successfully connected to Contentful" message.

Generating OG Images for Blog Posts

In this example use case, we want to generate OG images with titles and descriptions for each of our blog posts.

To get started:

  1. Create a data slot in the plugin - click "Create New" in your Data Slot list. This feature will store your Contentful field mappings and configurations for a specific Figma component.
  2. Select your OG image Figma Template as the main component.

Give your data slot a name, such as "og-image".

  1. Under "Content Type," you'll see a list of all the available content types from your Contentful project. Choose "Blog Post".

  2. The plugin supports localization, so under "Locale," you can choose between your available contentful locales, such as English (US) or German.

  3. Next, map the fields in your content type to the Figma component's layers. In this example, map the "Title" field to your title layer and the "Description" field to your description layer.

  4. Click "Apply Config" to see the OG image generated for one of your blog posts.

Repeating and Grid Layouts

To generate OG images for all blog posts:

  1. Edit the data slot and set the slot type to "Repeated."
  2. Choose a grid layout with two columns and two rows.
  3. Click "Apply Config" to see the OG images generated for each blog post in a grid format.

Working with Localized Content

To switch between localized versions of your OG images in Contentful:

  1. Edit your data slot.
  2. Change the chosen locale to another option, such as German.
  3. Click "Apply Config" to load the translated data and generate the appropriate OG images.

You can save your data slot settings, making it easy to return to the same configuration later. Click the "Save Config" button to store your settings in the data slot list.

Fetching Image Data from Contentful

The plugin also supports fetching images directly from your Contentful CMS.

To use this feature:

  1. Create a new data slot for a Figma component with an image layer.

  2. Choose the appropriate content type, such as "Blog Post."

  3. Map the Contentful image field (e.g., "Hero Image") to the Figma image layer.

  4. Set the data slot type to "Repeated" and choose a grid layout.

  5. After applying the configuration, you'll see the images loaded directly from Contentful into your Figma design.

Support for Non-Localized Data

The plugin follows Contentful's fallback behavior for fields that are not localized. For example, if an image field in your content type is not set to be localized, the same image will be used for both the English and German versions.

Sharing Data Slots with Your Team

When you save the configurations as data slots, other team members can access and use the same settings. They'll see the data slots you've created when they open the file, allowing them to quickly apply the same configuration to their designs.

Additionally, the plugin automatically selects the main component for a data slot when editing, making it easy to work with multiple configurations.

Wrapping Up

The Contentful to Figma plugin is an invaluable addition to your design toolkit. It streamlines the process of syncing data between your CMS and your designs, supports localization, and makes it simple to share configurations with your team. Give it a try and let us know what you think!

If you thought THAT was valuable, I've got more where that came from - and I can make sure you never miss out.


Khaled Garbaya

Written by Khaled Garbaya