Rich Text fields are textarea fields that use the WordPress rich text editor. This allows user to easily add bold text, links, ordered lists, blockquotes, etc.
Standard field options
A Rich Text field has the following standard options:
- Field type
- Required
- Unique
- Read Only
- Field key
- CSS layout classes
- Label position
- Field size
- Visibility
- Conditional logic
Field-specific options
In addition to the standard field options, Rich Text fields have field-specific options.
Rows
Set the number of rows to be displayed. By default, the value is set to 7.
Default values and field icons
You may add a default value to a rich text field by using the Rich text input in the field options setting.
Field action icons allow you to duplicate, delete, or move a field on the form builder page. See the field action icons article for more information.
Display Rich Text fields
Display the value submitted in a Rich Text field in a form's confirmation message, email, or View.
Shortcode options
- Display text: Display the submitted text. Paragraph tags will be added automatically.
[x]
Replace x with the ID or key of the Rich Text field.
- Text without paragraph tags: Display the submitted text without automatically adding paragraph tags.
[x wpautop=0]
Replace x with the ID or key of the Rich Text field.
- Truncate: Truncates text to the specified number of characters. By default, a link is appended to the end of the text. You can use the following parameters to modify or remove this link.
[x truncate=40]
Replace x with the ID or key of the Rich Text field and replace '40' with the number of characters you would like to display.
- More text: By default, this link will be "..." but can be changed with the parameter below. If this shortcode is inserted in a Dynamic View, the link will go to the detail page. Otherwise, it will show the full text in-place.
[x truncate=100 more_text="Read More"]
Replace x with the ID or key of the Rich Text field and replace '100' with the number of characters you would like to display.
- No Link: By default, when truncating text, there will be a link to show the remaining text. To remove this link, use the following shortcode. Please note, the no_link parameter requires the truncate parameter to also be used.
[x truncate=100 no_link=1]
- More text: By default, this link will be "..." but can be changed with the parameter below. If this shortcode is inserted in a Dynamic View, the link will go to the detail page. Otherwise, it will show the full text in-place.
- Remove links: Remove links from text.
[x links=0]
Replace x with the ID or key of the Rich Text field.
- Remove HTML: Removes all HTML from the displayed text.
[x striphtml=1]
Replace x with the ID or key of the Rich Text field.
Limitation
When displaying the value submitted in a Rich text field using the truncate parameter, the HTML needs to be stripped to avoid cutting in the middle of an HTML tag.
Related developer hooks
- Require a minimum, maximum, or range of words (or characters) with the frm_validate_field_entry hook.
- Change the options for the TinyMCE editor, like having an Add Media button, with the frm_rte_options hook.
- Limit the options for the TinyMCE editor with the frm_rte_options hook.