How do I reference other schemas in a schema?

Dynamic Data/content Reference Schema

To create structural or hierarchical data/content using schemas:

  1. Login to Experience Manager.

  2. Select a project.

  3. Select Schemas.

  4. Click Add (+) at the bottom right corner of the screen to create a new schema.

  5. Enter a name, select the type of schema (content/dynamic) and click ADD.

  6. Click the help icon.

  7. Click the Dynamic Data Reference from the popup window.

  8. Copy the code from the popup window. (The code from the pop-up window is given below.)

    {   "label": "Dynamic Ref Data",   "key": "dataref",   "isDefault": true,   "validation": [     {       "required": "true"     }   ],   "options": [],   "ref": "dynamic_keyname",   "fieldType": "schemarefdata",   "type": "String" }
  9. Add the code to the Schema Editor.

  10. In the key and ref field, place the other schema’s keyname.For example, you want to refer a schema named Test1 to the schema named Test2. You have to provide the keyname of Test1 (let the keyname be test1key) in the key field and ref field of schema named Test2. ie. "ref": "dynamic_test1key" for dynamic schema and "ref": "content_test1key" for content schema, and "key" : "test1key".

Keyname of Schema

  1. Open a schema in view mode.

  2. Copy the value next to the Key icon to get the keyname of the schema.

Please note that the keyname will always be in lowercase.

Related Articles