Section Bindings

Section bindings are placed in the name of a section and have a parameter which replaces the binding in the generated template.

Repeat

Duplicates all slides in the section for each element in the array found at the JSON path. If a section has more than one slide, they are duplicated sequentially.
<<Repeat:Label$ArrayPath>>

Parameters

  • Label
    Name of the section in the generated presentation.
  • ArrayPath
    JSON path for the array to iterate through.

SlideElement

Inserts the slides from another template into the presentation. The section must contain at least 1 slide which is used as a reference for where the slides are inserted. In the generated presentation, only the slides from the slide element will remain in the section.
<<Repeat:Label$FilePath$DataPath>>

Parameters

  • Label
    Name of the section in the generated presentation.
  • FilePath
    JSON path of the string that contains the template of the slide element. Path is relative tot eh current element in the array. The string can be either an URL for downloading the file, or a Base64 encoding of a file.
  • DataPath
    JSON path of the JSON object that will be used as input data for the slide element. Path is relative to the current element in the array.

SlideElementRepeat

A combination of the repeat and slide element binding. For each element in the received array, a slide element is inserted into the presentation.
<<SlideElement:Label$ArrayPath$FilePath$DataPath>>

Parameters

  • Label
    Name of the section in the generated presentation
  • ArrayPath
    JSON path of the array that the SlideElementRepeat will iterate
  • FilePath
    JSON path of the string that contains the template of the slide element. The path is relative to the current element in the array. The string can be either a URL for downloading the file, or a Base64 encoding of a file.
  • DataPath
    JSON path of the JSON object that will be used as input data for the slide element. The path is relative to the current element in the array.

Visibility

It is possible to conditionally hide sections of slides by using the Visible binding, it looks like so:
<<Visible:BindingKey$SectionNameIfShown>>

If the result of the binding is a falsy, the section is removed

Parameters

  • BindingKey
    JSON path of the value to bind to in the current scope
  • SectionNameIfShown
    If the value of the binding key is a truthy value, the section is visible, and the value of this parameter will be used as the name for the section

Nested sections (atm. repeat only)

DocuMotor supports nested section bindings to allow for a nested repeat of slides based on the input data.

All existing section & shape bindings inside nested sections will get processed according to data scopes.

The data type of the binding key must be a list.

Configuration

In order to define a start of a nested repeater, create an empty section named <<SectionBindingName:data>

Keep in mind that there is only one closing “>” since we span the sections.

In order to define an end of a nested repeater, create a new empty section named

<SectionBindingName>>

Closing nested repeater must have two “>>”

Example

An example of two repeaters. One being the main repeater for “properties” object and a nested repeater “floors” that exists under “properties”. Both are list types.

Besides that, there is a regular repeat binding for “suites” that exists under the “floors” object.

Presentation setup.

Example of sample data

{
  "repeatMadness": "Houses",
  "properties": [
    {
      "propertyName": "House of Meadows",
      "floors": [
        {
          "floorName": "HoM Level A",
          "suites": [
            {
              "suiteName": "HoM Level A Suite 1",
              "suiteStandard": "A1"
            },
            {
              "suiteName": "HoM Level A Suite 2",
              "suiteStandard": "A2"
            }
          ]
        },
        {
          "floorName": "HoM Level B",
          "suites": [
            {
              "suiteName": "HoM Level B Suite 1",
              "suiteStandard": "B1"
            },
            {
              "suiteName": "HoM Level B Suite 2",
              "suiteStandard": "B2"
            }
          ]
        }
      ]
      
    },
    {
      "propertyName": "House of Cards",
      "floors": [
        {
          "floorName": "HoC Level A",
          "suites": 
          [
            {
              "suiteName": "HoC Level A Suite 1",
              "suiteStandard": "A1"
            },
            {
              "suiteName": "HoC Level D Suite 2",
              "suiteStandard": "A2"
            }
          ]
        },
        {
          "floorName": "HoC Level B",
          "suites": 
          [
            {
              "suiteName": "HoC Level B Suite 1",
              "suiteStandard": "B1"
            },
            {
              "suiteName": "HoC Level B Suite 2",
              "suiteStandard": "B2"
            }
          ]
        }
      ]
    }
  ]
}