Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Schemas are not project-specific. If you define a schema, it will be available in any project within the same environment.
You cannot have duplicate schema name within the same environment.

Schema

...

A schema is created with the template for one field in the edit window using the following values for each element of the field.

...

Fields (fieldType). URL (url), Text (text), Rich Text (richtext), Media Embed (embed), File Upload (file), Date (Date), DateTime (datetime), Checkbox (checkbox), Dropdown (select).

...

Fields

You can use predefined templates for each field.

  1. Go to the Schema edit page.

  2. Click on the help icon next to the schema editor to get the help window.

    Image Added
  3. On the help window, click on the field type you wish to add to the schema.

    Image Added

    For example, if you wish to add a text field to the schema, click on Text.

    Image Added
  4. Copy the schema field code from the pop-up window.

  5. Image Added

    Close the pop-up window and paste the copied content to the schema editor.

  6. Change the label and key (should be unique) properties to identify the field.

    Image Added
  7. Save the schema.

The code for the schema field typically contains the below-listed properties.

Code Block
 {
  "label": "Sample",
  "key": "sample",
  "isDefault": false,
  "validation": [
    {
      "required": false
    }
  ],
  "options": [],
  "multiple": false,
  "ref": "",
  "fieldType": "text",
  "type": "String"
  "es": "geo_point",
  "comment": "this is a comment"
}

...

Field Property

Description

label

Enter a label for the field.

key

Use lowercase alphabetic letters without spaces.

...

Label. Use CamelCase letters.

isDefault

Boolean (true or false). This feature has been deprecated. The default value is false.

...

validation

An array with the “required” object, which can be true or false.

options

...

Options. Empty array for all except checkbox and dropdown which have a key/value pair.

This array will be used when you use fields such as checkbox, file, dropdown and so on.

multiple

ref

This field is used to refer another schema within this schema. See, How do I reference other schemas in a schema?

fieldType

Represents the type of field you are going to add. You can see the list of supported field types from the help window.

type

Represents the datatype of the field. (values the field can take). For example, string, boolean, integer, and so on.

es

Elasticsearch Supported types are available at https://www.elastic.co/guide/en/elasticsearch/reference/6.8/mapping-types.html

comment

You can add comments using this property.

To add extra fields, copy the object structure with the fields array and add it with the comma-separated values before the end of the fields array().

Info

When creating a Content schema, the Experience Manager automatically creates the Title and Tags fields in your schema. These fields are mandatory.

The TTL(in days) is the time after which the documents created based on this schema will get removed after the specified time.

Example: Create a Visit Tracker

...