Configure the Key Text Field

This article explains what the Key Text field is and how to configure it in the Custom Type builder.


Key Text vs. Rich Text

The Key Text field has no formatting options. It returns a string in the API response. This makes the Rich Text field more complex and configurable. To learn more about these differences, see the Rich Text documentation.

The Key Text field allows content writers to enter a text string, it does not output any HTML. This makes it different from the Rich Text field, which outputs formatted text.

Screenshot of the Key Text field in the drag-and-drop editor.

The visual builder

When configuring a Key Text field, you'll see the options to set the Field name, API ID, and Field placeholder.

Screenshot of the Key Text field editor.

JSON model

The following table displays the JSON configuration options available in the JSON editor.

type
string (required)

Value must be Text

config

object

Object for the configuration options

config.placeholder
string

A user-friendly placeholder for the field in the entry editor

config.label

string

The label that shows up for the field in the entry editor

Example JSON configuration

The following JSON defines a Key Text field with a label and placeholder:

Copy
"description": {
  "type": "Text",
  "config": {
    "label": "Product Description",
    "placeholder": "Enter the product description..."
  }
}

API response example

Here is an API response example of a Key Text field with the API ID of example_key_text:

Copy
// API response example of a Key Text field

{
  //...
  "example_key_text": "Lorem Ipsum",
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.