Plain text field overview
The plain text field is a Collection field that is best used for basic text that doesn't need formatting like headings, inline styles, or inline media.
The plain text field is a Collection field best used for short text blocks or a short paragraph related to a Collection item — basic text content that doesn't need special formatting like headings, inline styles, or inline media like images or video. You can also use plain text fields to filter and sort Collection lists or show specific elements using conditional visibility on Collection pages or in lists.
Multi-line plain text fields in the CMS make it easier to enter text across multiple lines to input, store and edit text that wouldn't fit in a single-line Plain text field. The text displays in the browser as plain text, wrapped in an element.
To add any inline styling (including line breaks) to CMS content, use the Rich text field instead.
Common uses
- Short-form text that doesn't need any formatting
- Names and titles
- Team member bios
- Product descriptions
- Event descriptions
Pro tip: Plain Text works great when you want to limit the amount of formatting the collaborators can do. Contrary to the rich text field, plain text doesn't allow any inline styling, so the output will remain clean.
In this lesson:
- Creating a plain text field
- Displaying plain text
- Filtering a Collection list using the plain text field
- Sorting a Collection list using the plain text field
- Setting conditional visibility using the plain text field
Creating a plain text field
A plain text field can be added to a new or existing Collection. In Collection settings, click on New Field and then choose the Plain Text field.
Before saving the field, specify the Text field type. You can also set a minimum character count and/or a maximum character count that is allowed for this field. And as with any field, you can add a Help text and specify if the field is required or not.
Text field types
A plain text field allows you to add a short text block or a single paragraph to a Collection item. As a designer, you can specify the type and function of a text field by setting the text field type:
- Single-line (for shorter text)
- Multiple-line (for longer text)
This will change how the text field is displayed in the CMS Panel and the Editor.
Displaying plain text
The plain text field can be connected to any text element.
- Add a text element in a Collection list or on a Collection page
- Check the Get text from checkbox in the Settings window that appears
- Connect it to the relevant plain text field from the field dropdown
You can also access these Settings by selecting the text element and either clicking on the settings icon next to the element label on the canvas or by going to the Settings panel (D). To remove the connection, uncheck the “Get text from” checkbox.
Filtering a Collection list using the plain text field
To filter your Collection list using a plain text field:
- Select the Collection list you want to filter
- Go to the Settings panel (D)
- Add a Filter under Collection List Settings
- Select the relevant plain text field in the first dropdown
- Choose a rule in the second field
- Specify the value if needed
- Click Save
The filter rules that you can use with the plain text field and values are:
- Equals - looks for Collection items with a plain text string equal to the value you specify for this rule
- Does Not Equal - looks for Collection items with a plain text string that isn’t equal to the value you specify for this rule
- Is Set - looks for Collection items that have any value set for this plain text field
- Is Not Set - looks for Collection items that don’t have any value set for this plain text field
Learn more about filtering Collection lists.
Need to know
Is Set and Is Not Set aren't available for the Name text field which is required by default, and thus is set always.
Sorting a Collection list using the plain text field
You can use plain texts to sort Collection items by name or last name or any text field:
- Select the Collection list you want to sort
- Go to the Settings panel (D)
- Add a Sort order under Collection List Settings
- Select your plain text field in the first dropdown
- Choose the sort order in the second dropdown: alphabetical order (A-Z) or in reverse alphabetical order (Z-A).
- Click Save
Setting conditional visibility using the plain text field
You can set conditional visibility to show or hide individual elements in a Collection list or on a Collection page using the plain text field. For example, if you have a button element that is connected to a plain text field as well as a link field. You can set two conditions to ensure that the button is visible on the page only when the link and the text field are set.
- Select the button
- Go to the Settings panel (D)
- Add a Condition (when this element is visible) under Conditional visibility
- Select your plain text field in the first dropdown
- Choose Is set in the second dropdown
- Click Save
Add another condition for the link field.