Strings can have a format field defined. As well as validating the value of the string, this also controls how the string will be shown in the user interface in the Content Editing window. This is known as a semantic hint.
Some of these formats are defined in the JSON Schema specification and some are Amplience extensions.
The text and symbol types are used as semantic hints to the UI, they do not change the way the string is validated. If no format is specified, then symbol is the default format.
The markdown format is an Amplience specific format which is used as a semantic hint by the user interface to open the markdown editor to allow the user to edit the value.
The string formats are shown in the table below. For those formats where we've included an example, just click the link to go directly to the example on this page.
|text||A string of natural language text.|
|symbol||Not a natural language value. Typically something like a product SKU|
|uri||A universal resource identify which must be valid according to RFC3986. Must be a full URI of the format http://www.amplience.com|
|date-time||Must be a valid date as defined in RFC 3339, section 5.6.|
|Must be a valid email address as defined in RFC 5322, section 3.4.1|
|markdown||Tells the user interface to display a markdown editor. The value can be any valid string.|
Here are examples of some of the strong formats, together with images to show how properties of this string format appear in the content editing user interface.
The following shows a simple text field representing a headline, with a maximum length of 256 characters. The UI in the content editing form shows the current and maximum character count.
The uri format must be a complete uri such as http://example.com.
The following shows the callToActionUrl field from the tutorial banner example:
The email format must be a complete, valid email address of the form firstname.lastname@example.org. The following shows a example string property with this format:
The markdown format does not do any validation of the string, because the entire value is treated as markdown format. When the content editing form encounters a string property in markdown format, it provides a full markdown editor as shown in the image below.