What is the slice model.json format

Description of a slice model

  • id: A unique identifier for the slice in snake_case.
  • type: Specifies the slice type as "SharedSlice".
  • name: The name of the slice in PascalCase.
  • description: A description of the slice.
  • variations: An array containing the variations of the slice. Each variation has:
    id: A unique identifier for the variation.
    name: The name of the variation.
    description: A description of the variation.
    primary: An object containing non-repeatable fields, each with: type: The field type (e.g., "Text", "StructuredText", "Link", "Image", "Select", "Boolean", "Embed", "Number"). config: An object with properties specific to the field type like label, placeholder, select, allowTargetBlank, thumbnails, constraint, default_value.
    items: An object containing repeatable fields, structured similarly to primary.
    docURL: this string "..."
    version: this string "initial"
    imageUrl: an empty string ""

List of fields in primary or items

Text:

  1. type: "Text"config:label: Label for the field.placeholder: Placeholder text.
  2. StructuredText: type: "StructuredText"config:label: Label for the field.placeholder: Placeholder text.single: Restricts to a single block type (e.g., "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "paragraph", "preformatted", "strong", "em", "list-item", "o-list-item", "group-list-item", "group-o-list-item", "image", "embed", "hyperlink").multi: Allows multiple block types (e.g., "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "paragraph", "preformatted", "strong", "em", "list-item", "o-list-item", "group-list-item", "group-o-list-item", "image", "embed", "hyperlink").
  3. Link: type: "Link"config:label: Label for the field.placeholder: Placeholder text.select: Specifies the link type (e.g., "web", "document", "media").
  4. Image: type: "Image"config:label: Label for the field.constraint: Specifies size constraints (e.g., {"width": 500, "height": 500}).thumbnails: Definitions for image thumbnails (e.g., {"name": "thumbnail", "width": 200, "height": 200}).
  5. Select: type: "Select"config:label: Label for the field.placeholder: Placeholder text.options: Array of options (e.g., ["Option 1", "Option 2"]).
  6. Boolean: type: "Boolean"config:label: Label for the field.default_value: Default value (true/false).
  7. Embed: type: "Embed"config:label: Label for the field.placeholder: Placeholder text.
  8. Number: type: "Number"config:label: Label for the field.placeholder: Placeholder text.