WYSIWYG
WYSIWYG fields provide a visual editor for formatted content. This page covers the options available when editing a WYSIWYG field in the Field Editor.
Basic options
Section titled “Basic options”- Field label
The text displayed beside the field when editing a record.
- Database Field
The name the database and program use to refer to the field. In viewers you reference it as:
<?php echo $record['fieldname'] ?>If you rename an existing field, update any references to it in your viewers and Database Editor settings. Some field names have special built-in behavior. See Special Fieldnames.
- Field type
The type of input the field accepts. Each field type has different options. Note that the separator field type doesn’t require a field label or field name.
- Help tooltip
Displays a help icon after the field label; hovering over it shows this message as a tooltip.
Visibility
Section titled “Visibility”- Show for
Limits who can see and edit the field: Everyone, Editors and admins, Admins only, or Nobody. Users without access don’t see the field when creating, modifying, or viewing records (new records save the default value), and the field isn’t shown as a list column.
- Show if
Shows or hides the field on the record edit page based on another field’s value. Pick a field, an operator, and a value. Operators are equals, does not equal, contains, starts with, and ends with (is checked / is not checked for checkbox fields). Use
|between values to match any of several (e.g.draft|pending); for multi-value fields, any matching value counts.Select Custom expression for AND conditions and multi-field rules, using
=,!=,*=(contains),^=(starts with), and$=(ends with) as operators, e.g.type=article AND status!=draft|pending. AND binds tighter than OR,field=matches empty or unchecked, andfield!=matches any value.
Field options
Section titled “Field options”Options specific to the field type appear in this section. For most fields the defaults will be sufficient, but for list fields you will need to set the values for your list options.
- Default value
The default value the field shows when creating a new record.
- Existing records
Shown only when adding a new field. Check “Update all existing records with the default value above” to fill the new column for existing records; otherwise existing records get NULL.
- Field prefix
Text displayed before or above the field.
- Field description
Text displayed after the field.
- Field height
The height of the field in pixels. Leave blank for the default height.
Validation
Section titled “Validation”- Required
Requires the user to enter a value for the field, showing an error if the field is left blank.
- Unique
Requires the user to enter a unique value for the field, showing an error if another record has the same value.
- Length
The minimum and maximum length for the field value, in characters. An error is shown if the value is shorter or longer. Leave either input blank for no limit.
Uploads
Section titled “Uploads”- Allow uploads
Determines whether uploads are allowed for the field. When enabled, a browse button in the editor’s Insert Link and Insert Image dialogs opens a file picker for the field’s uploads.
- File extensions allowed
A comma-separated list of file types (by extension) that can be uploaded. Users uploading a file with an extension not on the list get an error message.
- Maximum uploads
The maximum number of uploads allowed for the field. Leave unchecked to allow unlimited uploads.
- Maximum upload size
The maximum file size allowed per upload. Leave unchecked to allow any size.
- Resize images larger than
When enabled, uploaded images larger than the specified dimensions are automatically resized down to fit.
- Create thumbnail
When enabled, a smaller thumbnail is automatically generated for each uploaded image. Up to four thumbnail sizes can be configured (“Create thumbnail” through “Create thumbnail (4)”), each with its own dimensions, a crop option, and a recreate link for regenerating existing thumbnails.
- Upload directory
By default files are stored under the program’s
uploads/folder. Checking “Use custom upload directory” reveals Directory Path and Folder URL inputs for storing this field’s uploads and thumbnails in a custom location.
Advanced options
Section titled “Advanced options”- System field
System fields cannot be edited and have no modify or erase link unless “System Field Editing” is enabled (under Advanced Commands on the field list page). This prevents accidental changes to fields the program relies on.
- MySQL column type
The MySQL column type used to store the field. Auto (the default) picks a type appropriate to the field type; you can also choose from preset text/string, numeric, and date/time types, or enter a custom column type.
- MySQL indexing
Creates a MySQL column index for the field, which speeds up sorting and some searches but slows down adding and saving records.
- Data encryption
Automatically encrypts data stored in the column. Requires a database encryption key (set on the Security settings page) and the MySQL general query log to be disabled; enabling encryption also sets the column type, which can’t be changed while encryption is on. Back up the database before encrypting, and back up the encryption key. Without it the data is unrecoverable.
In viewers
Section titled “In viewers”The field holds the content as HTML markup, exactly as saved by the editor. Echo it directly without encoding so the markup renders:
<?php echo $record['content'] ?>Images and links inserted through the editor are part of the stored HTML, including the paths of files uploaded from the Insert Link and Insert Image dialogs.
WYSIWYG fields add no field-type pseudo-fields; every record still carries
the standard ones such as _link. See the
Pseudo-field Reference.