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 element values

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

...

Info

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

Example: Create a Visit Tracker

The following examples create a schema called VisitTracker.

  1. Log in as an Administrator to the Experience Manager.

  2. Click Schema Management and then Content Types.

  3. Click Add (plus button in the middle panel).

  4. Enter the following information:

    • Name. VisitTracker

    • Description. Track the number of visits

    • Tags. VisitTracker

  5. In the schema edit panel, enter:

    Code Block
    {
      "fields": [
        {
          "key": "yearmonthday",
          "label": "year month day",
          "isDefault": true,
          "validation": [
            {
              "required": true
            }
          ],
          "options": [],
          "ref": "",
          "fieldType": "text",
          "type": "String"
        },
        {
          "label": "Number of Visits",
          "key": "numbervisits",
          "isDefault": false,
          "validation": [
            {
              "required": true
            }
          ],
          "options": [],
          "ref": "",
          "fieldType": "text",
          "type": "Number"
        },
        {
          "label": "UserId",
          "key": "userid",
          "isDefault": true,
          "validation": [
            {
              "required": true
            }
          ],
          "options": [],
          "ref": "",
          "fieldType": "text",
          "type": "String"
        }
      ]
    }
  6. Click the Check icon when you are done to save your changes.

Example: Create a Tip Node

  1. Log in as an Administrator to the Experience Manager.

  2. Click Schema Management and then Content Types.

  3. Click Add (plus button in the middle panel).

  4. Enter the following information:

    • Name. Node Tips. (In the Content Demo flow, the Name of the schema is rich text.)

    • Description. Tips for building specific types of nodes.

    • Tags. node, tips.

  5. Include two fields: NodeType of node and Tip.

    • Copy the lines in the schema edit window from the open curly bracket (“{”) before label to the closed curly bracket (“}”) after the type.

    • Add a comma after the last curly bracket.

    • Paste what you had copied previously.

  6. Copy the two fields from their open curly bracket (“{”) before the label attribute in the first field to the close curly bracket (“}”) after the type attribute in the second field.

    Note: Be sure to not include the comma in what you copy.

  7. Toggle to your JSON editor and paste the field definitions

    Note: You will get error notification on the line that includes the close curly bracket and the comma after the first field. Ignore it for now.

  8. In the schema edit panel, enter:

    Code Block
    {
      “key”: “NodeType”,
      “label”: “NodeType”,
      “isDefault”: “true”,
      “validation”: [
        {
          “required”: “true”
        }
      ],
      {
      “key”: “Tip”,
      “label”: “Node Tip”,
      “isDefault”: “false”,
      “validation”: [
        {
          “required”: “true”
        }
      ],
      “options”: [],
      “ref”: “”,
      “fieldType”: “text”,
      “type”: “String”
    }
  9. Click the Check icon when you are done to save your changes.

Info

Editing Tip

You can copy the code from above and paste it into the Schema edit panel. You can also use an online JSON editor, such as http://www.jsoneditoronline.org/, to create your JSON code. It will help ensure your JSON is well-formed. When you are done, you can copy and paste it from the editor into the Schema edit panel.

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "schema"