...
In addition to the template, model (and optionally position), you can add other parameters if you want. They will be returned by the Narrative API, but will be fixed (so they will always be returned in the same way for the same Layout Block).
...
2. Define the
...
JSON SCHEME
...
After creating your JSON SCHEME with the jdorn editor demo link and confirming with the preview of the generated form that it is valid and appears as you would expect (remember, this will be the form which will appear in the Narrative Editor for the marketing department), you can copy & paste it in the dialog in the JSON schema textarea (as in the image above).
In this example, we have a banner with localized values for 3 parameters:
Link when the banner is clicked (Banner Redirect URL)
Image source for the banner (Banner Source)
Alt text appearing as mouse-over on the image (Banner Alternative Text)
Info |
---|
For every parameter which is localized (meaning it could be different in each language), the structure of the example must be followed, so your property must be of the type “object” and have sub-properties with, as keys, the possible language codes (e.g.: “en”, “de”, “fr”, “it”, …). The value of each language must be of the type “string”. In the response from the Narrative API, you will not receive the same structure, but only one string value for that property with the value in the requested language (i.e.: in this example, “banner_redirect” will be set with String as value with the value in the requested language). |
Code Block |
---|
{ "title": "Banner", "type": "object", "properties": { "banner_redirect": { "type": "object", "title": "Banner Redirect URL", "properties": { "de": { "type": "string", "description": "Set Banner Redirect URL in German." }, "fr": { "type": "string", "description": "Set Banner Redirect URL in French." } } }, "banner_src": { "type": "object", "title": "Banner Source", "properties": { "de": { "type": "string", "description": "Set Banner Source in German." }, "fr": { "type": "string", "description": "Set Banner Source in French." } } }, "banner_alt": { "type": "object", "title": "Banner Alternative Text", "properties": { "de": { "type": "string", "description": "Set Banner Alternative Text in German." }, "fr": { "type": "string", "description": "Set Banner Alternative Text in French." } } } } } |