How do I reference other schemas in a schema?
Dynamic Data/content Reference Schema
To create structural or hierarchical data/content using schemas:
Login to Experience Manager.
Select a project.
Select Schemas.
Click Add (+) at the bottom right corner of the screen to create a new schema.
Enter a name, select the type of schema (content/dynamic) and click ADD.
Click the help icon.
Click the Dynamic Data Reference from the popup window.
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" }
Add the code to the Schema Editor.
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
Open a schema in view mode.
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.