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

Custom Fields

A field in Builder is a piece of data on a model. For example, the built-in Page model comes with two fields, a Title and a Description. These two fields help define what a Page is. Any time you make or edit any kind of model in Builder, you have the option of editing fields or adding custom fields.

This document covers:

The following video shows some example custom fields on the three kinds of models in Builder: the Page, Section, and Data models.

Prerequisites

To get the most out of this document, make sure you've integrated Pages, Sections, or Data. The following tutorials give step-by-step instructions:

Integrate page building

Integrate section building

Overview of custom fields

Custom fields are fields that you add to a model. You can add custom fields to models you create or to an existing model, such as the built-in Page model. All kinds of Builder models accept custom fields, so you can add the fields you need to Page models, Section models, and Data models.

Examples of custom fields include data such as title, URL, name, timestamp, or any piece of data you want to define on a model. You define and specify aspects of your custom fields such as:

  • Type: There are many types available in Builder. Refer to Custom field types for more detail.
  • Localization: Translate fields according to region settings.
  • Default value: Pre-populate the custom fields you create.
  • Helper text: Give your users a helpful hint about what to enter into the field.
  • Required: Make a field required or optional.
  • Enum: Give users a predefined list of options.
  • Hidden: Make a given field hidden when editing content.

The following video shows where to find custom fields on a model, points out the available field Types, and then shows Page and Section custom fields in the Visual Editor's Option tab.

Adding custom fields to a model

You can add custom fields to any model in Builder by doing the following:

  1. Open the Model.
  2. Click the + New Field button.
  3. Name the field.
  4. Choose a Type.
  5. Configure any other settings for the field and add additional fields as needed.
  6. Scroll to the top and click Save.

The following video shows adding a custom field called seoImage to a Page model.

For Pages and Sections, the custom fields you create display in the content entry on the Options tab as in the following image.

For Data, the custom fields you create on the Data model are available in the Data entry. For example, a hypothetical Blog Author Data model has three custom fields, Name, Photo, and URL. The following video shows the custom fields on the Data model and using those fields in a Data entry for a new Blog Author.

To delete a custom field, click the x to the right of the field.

Using field values in your code

When you have custom fields on your model you can add specific values to the content and use those values however you want in your code. This example queries the Builder API to get the SEO image and a Canonical URL fields.

Tip: To interactively explore the data that is sent from the Builder API, check out the Builder API Explorer where you can query the Builder API using your actual data.

Querying by field values

You can also filter content by using queries with your custom field values. This technique is useful if you want to retrieve content that only has a certain custom attribute. For example, you could filter for only entries that have a certain Canonical URL. For more information on how to use queries on your API calls, refer to Content API and the HTML API or in the options object of any JS SDK.

Custom field types

The following table describes each Type in Builder along with an image of how each Type renders in the Builder UI.

Tip: This section covers the built-in types for models, but you can also make your own with plugins. For more information, see Making Your Own Plugins Overview.

Text

Text is analogous to the text type in HTML. With the Text type, you can specify minimum and maximum length.

Long Text

Long Text accommodates multi-line text. With the Long Text type, you can specify minimum and maximum length.

URL

The URL Type accommodates a URL, also known as a web address.

File

Use the File Type to specify what kind(s) of file a user may upload to a custom field.

Number

The Number file type specifies that the value that the user enters must be a number.

Boolean

The Boolean Type provides a toggle for a true/false setting.

Rich text/HTML

The Rick text/HTML Type provides a rich text interface with styling options and a toggle to write directly in HTML. Click the code icon, <>, at the upper right to toggle the HTML editor.

Date

Use the Date Type to accept a date from the user. When the user clicks on the input, a datepicker opens

Timestamp

Use the Timestamp Type to accept a date from the user. When the user clicks on the input, a date picker opens with a time picker. Though the Date and Timestamp Types appear similar, prefer Timestamp querying.

Color

Use Type Color to provide users with a color picker.

List

Use the List Type when for a series of items.

Reference

Use the Reference type when you have Data entries that users choose from. For example, you could have a Blog Author custom field and when you click the Choose Entry button, all Blog Author Data entries display.

Map

Text

Use the Map type when you want users to provide a collection of key-value pairs.

JavaScript

Use the JavaScript type so users can provide JavaScript code snippets.

Code

Text

Use the Code type for accepting JavaScript, HTML, CSS, or other type of code.

Tags

Use the Tags type for adding Tags. The field is empty by default. To add tags, type the tag you'd like and press Enter. Click the x to delete a tag.


Need Expert help?

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

Submit a project

Was this article helpful?