Form design schema
Definition of the JSON object that allows the creation and customization of the forms.
To create a form, you can use the different FieldTypes
,
which have their own configuration properties but all of them inherit the properties of the BaseField
model.
Additionally, in the design of the JSON object, the following features can be used:
Interface
interface IFormDesign {
groups: IGroup[];
}
Example
Form
{
"groups": [
{
"fields": [
{
"name": "title",
"type": "Text",
"label": {
"en-US": "Title",
"es-ES": "Título"
},
"description": {
"en-US": "Write a title for the article",
"es-ES": "Escriba el título del artículo"
},
"validation": {
"required": true
}
},
{
"name": "pageDesign",
"type": "Dropdown",
"label": {
"en-US": "Page design",
"es-ES": "Diseño de página"
},
"description": {
"en-US": "Select a page design to create the article",
"es-ES": "Seleccione el diseño de páginapara crear el artículo"
},
"validation": {
"required": false
},
"options": "{pageDesigns}"
},
{
"name": "summary",
"type": "TextArea",
"label": {
"en-US": "Summary",
"es-ES": "Resumen"
},
"description": {
"en-US": "Write a summary about the article",
"es-ES": "Escriba un resumen sobre el artículo"
}
},
{
"name": "isHighlighted",
"type": "Toggle",
"label": {
"en-US": "Promote to Home page",
"es-ES": "Destacada en la página Home"
},
"description": {
"en-US": "Select if you want to promote the article on the Home page",
"es-ES": "Seleccione si desea destacar la noticia en la página Home"
},
"validation": {
"required": false
},
"checkedText": {
"en-US": "Yes",
"es-ES": "Sí"
},
"uncheckedText": {
"en-US": "No",
"es-ES": "No"
}
},
{
"name": "isBanner",
"type": "Toggle",
"label": {
"en-US": "Promote to the banner on the Home page",
"es-ES": "Destacar en el banner de la página Home"
},
"description": {
"en-US": "Select if you want to promote the article on the banner of the home",
"es-ES": "Seleccione si desea destarcar la noticia en el banner de la página Home"
},
"validation": {
"required": false
},
"checkedText": {
"en-US": "Yes",
"es-ES": "Sí"
},
"uncheckedText": {
"en-US": "No",
"es-ES": "No"
}
},
{
"name": "image",
"type": "UploadImage",
"label": {
"en-US": "Image",
"es-ES": "Imagen"
},
"description": {
"en-US": "Drop the image that you want to set in this article",
"es-ES": "Arrastre la imagen que quiera añadir al artículo"
},
"boxLabel": {
"en-US": "Try dropping some files here or click to select files to upload.",
"es-ES": "Arrastre algunos ficheros o clique para seleccionar la imagen a subir."
}
},
{
"name": "category",
"type": "TermSet",
"label": {
"en-US": "Category",
"es-ES": "Categoría"
},
"description": {
"en-US": "Select a category for your article",
"es-ES": "Seleccione la categoría del artículo"
},
"termSetNameOrID": "2bd88977-3669-4cb4-a022-9fbcc7b5faa1"
},
{
"name": "audience",
"type": "Audience",
"locationField": {
"name": "locations",
"label": {
"t": "forms.locations"
},
"description": {
"t": "forms.locationsDescription"
},
"termSetNameOrID": "b49f64b3-4722-4336-9a5c-56c326b344d4"
},
"departmentField": {
"name": "departments",
"label": {
"t": "forms.departments"
},
"description": {
"t": "forms.departmentsDescription"
},
"termSetNameOrID": "8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f"
}
},
{
"name": "author",
"type": "PeoplePicker",
"label": {
"en-US": "Author",
"es-ES": "Autor"
},
"description": {
"en-US": "Write the name of the author that will own the content",
"es-ES": "Escriba el nombre del autor que será propietario del contenido"
},
"numberOfItems": 1,
"minLengthKeyPress": 0,
"principalTypeDistributionList": false,
"principalTypeSecurityGroup": false,
"principalTypeSharePointGroup": false
},
{
"name": "publishingDate",
"type": "DatePicker",
"label": {
"en-US": "Select publishing date",
"es-ES": "Seleciona fecha de publicación"
},
"placeholder": {
"en-US": "Select a date...",
"es-ES": "Selecciona una fecha..."
},
"validation": {
"required": false
},
"showTimePicker": true,
"showClearButton": true
},
{
"name": "dueDate",
"type": "DatePicker",
"label": {
"en-US": "Select a due date",
"es-ES": "Seleciona a due date"
},
"placeholder": {
"en-US": "Select a date...",
"es-ES": "Selecciona una fecha..."
},
"validation": {
"required": false
},
"showTimePicker": true,
"showClearButton": true
},
{
"name": "tags",
"type": "TagPicker",
"label": {
"en-US": "Tags",
"es-ES": "Etiquetas"
},
"description": {
"en-US": "Add tags to your article to help others find it",
"es-ES": "Añada etiquetas al artículo para ayudar a los demás a encontrarla"
}
},
{
"name": "community",
"type": "CommunityPicker",
"label": {
"en-US": "Community to share",
"es-ES": "Comunidad donde compartir"
},
"description": {
"en-US": "Specify in which community the article will be published",
"es-ES": "Especifique en qué comunidad se publicará el artículo"
},
"validation": {
"required": true
},
"allowSelectDestinationList": false,
"validatePermissions": true
},
{
"name": "relativeFolderPath",
"type": "FolderBrowser",
"label": {
"en-US": "Folder",
"es-ES": "Carpeta"
},
"validation": {
"required": true
},
"communityFieldName": "community",
"value": "/"
},
{
"name": "submit",
"label": {
"en-US": "Create",
"es-ES": "Crear"
},
"type": "Submit",
"showCancel": true,
"endpoint": "{@togoSettings.apiEndpoints.provisioning}/AddonContent/Add",
"method": "post",
"redirectUrl": "{url}"
}
]
}
]
}
Properties
groups
Array of the set of sections that the form will have.
-
Type:
Group[]
-
Required: Yes