Made in Builder

Made in Builder

×

Developers

Product

Use Cases

Pricing

Developers

Resources

Company

Get StartedLogin

Product

Features

Integrations

Talk to an Expert

Pricing

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

Popular Tutorials

>

Create a Site Theme

This tutorial shows you how to create a Data model for site theme colors, create seasonal content entries for different color palettes, and use the different color themes with content.

Skill set: Intermediate

Area: UI only

Length: 3 minutes

This tutorial guides you through using Data content entries with color palettes to instantly change the colors on a Page as in the following video.

Prerequisites

  • Youʻll need a Builder account.
  • An evergreen browser; that is, a modern, up-to-date browser such as Google Chrome.

Step 1: Create a data model

  1. Go to Models.
  2. Click the + Create New button.
  3. Name and describe your model. This example uses the name Site theme and the description Colors for site.
  4. Add a custom field by clicking on the + New Field button.
  5. Name the new field according to the colors you want to use and set the Type to Color. Here, the color fields are Header, Body copy, Primary, and Secondary. Repeat for each custom field. By setting the Type to Color, you provide a color picker to teammates using the data model to create content entries.
  6. Click Save.

The following video demonstrates the above process:

Step 2: Use your data model to make content entries

The next step is to use the Data model you just made. To have two sets of colors to toggle between, you need two content entries. Follow these instructions to make one content entry for Spring Colors and another content entry for Fall Colors.

  1. Go to Content.
  2. Click the + New button.
  3. Select Site theme.
  4. Name the new content entry Spring Colors.
  5. Pick a color for each of the custom fields; Header, Body copy, Primary, and Secondary.
  6. Click Publish.
  7. Repeat these steps to create a Fall Colors content entry.

This video shows the process of making the two content entries:

Step 3: Use the colors with your content

  1. Go to the Page or Section content entry where you'd like to use the colors from the Data content entry you created in the previous section. This example uses a pre-made Page with some placeholder content.
  2. Go to the Data tab.
  3. Click the Builder icon.
  4. In the dialogue that opens, choose Site theme.
  5. Click the Pick an Entry button.
  6. Choose Fall Colors.
  7. Select a Text block and go to the Style tab. Open the Typography section and select Text Color > Binding.
  8. Under Get the value for this from, select Site Theme - Data - Header.

Repeat to apply colors to other blocks. In addition to text blocks, the next video includes changing the color of Box blocks. To change the background color of a block as in this video, open the Background section > Fill color > Binding and choose the color.

Tip: To switch between Data content entries, such as Fall colors and Spring colors in this example, go to the Data tab, click the pencil icon next to the current Site theme, and select another Site theme. The video below shows toggling between the Fall and Spring color palettes and how the colors on the page switch instantly.

Next steps

To get even more out of Data models with Builder, check out Integrating CMS Data.

If you're ready to dig into some code for an editable theme, see the Builder Next.js Shopify starter on GitHub.

For more general information on Data models, refer to the Data Models documentation.


Need Expert help?

Submit a project to our partners, BuildQuick, and be matched with a Builder expert.

Submit a project

Was this article helpful?