Open Presentation

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    List Variable

    A list of strings, for bullets and list items. A whole-string array element 'var:<id>' splices every entry into the array in place; a whole field 'var:<id>' becomes the array; '{{<id>}}' joins the entries with ', ' (or the separator after a pipe: '{{<id>|; }}').

    Metadata

    Definition
    #/$defs/ListVariable
    Form
    object
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    typeconstyesVariable kind. One of color, text, number, date, image, url or list.
    type · Allowed values
    "list"
    valuearray<string>—Entries this variable resolves to.
    requiredboolean—Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot: an unfilled optional variable resolves to empty text (inline tokens) or the field that references it is omitted.
    labelstring—Optional short human label for forms and fill panels.
    descriptionstring—Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents.
    examplearray<string>—Illustrative entries shown in fill forms and used when a template is previewed with examples. Never written to output.
    maxItemsinteger—The most entries the list may have. Checked on the declared value and on a value given to a fill; a longer list is the warning opf/variable-overflow. Fill forms and models read it before writing.
    translationsobject—The entries in other languages, keyed by language tag, each entry a 'value' list. Where the variable is drawn, the slide's declared language (else the deck's) selects an entry: the exact tag, then the tag with its last subtag removed, and so on ('de-AT', then 'de'), compared without regard to case; no match draws 'value'. A language read from the text does not select one. A fill that gives the variable a new value without translations removes them.

    type

    typeconstrequiredyesdefault—

    Variable kind. One of color, text, number, date, image, url or list.

    type · Allowed values
    "list"
    type.json
    {
      "type": "list"
    }

    value

    typearray<string>requirednodefault—

    Entries this variable resolves to.

    required

    typebooleanrequirednodefaulttrue

    Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot: an unfilled optional variable resolves to empty text (inline tokens) or the field that references it is omitted.

    label

    typestringrequirednodefault—

    Optional short human label for forms and fill panels.

    description

    typestringrequirednodefault—

    Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents.

    example

    typearray<string>requirednodefault—

    Illustrative entries shown in fill forms and used when a template is previewed with examples. Never written to output.

    maxItems

    typeintegerrequirednodefault—

    The most entries the list may have. Checked on the declared value and on a value given to a fill; a longer list is the warning opf/variable-overflow. Fill forms and models read it before writing.

    translations

    typeobjectrequirednodefault—

    The entries in other languages, keyed by language tag, each entry a 'value' list. Where the variable is drawn, the slide's declared language (else the deck's) selects an entry: the exact tag, then the tag with its last subtag removed, and so on ('de-AT', then 'de'), compared without regard to case; no match draws 'value'. A language read from the text does not select one. A fill that gives the variable a new value without translations removes them.

    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "const": "list",
          "description": "Variable kind. One of color, text, number, date, image, url or list."
        },
        "value": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Entries this variable resolves to."
        },
        "required": {
          "type": "boolean",
          "default": true,
          "description": "Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot: an unfilled optional variable resolves to empty text (inline tokens) or the field that references it is omitted."
        },
        "label": {
          "type": "string",
          "description": "Optional short human label for forms and fill panels."
        },
        "description": {
          "type": "string",
          "description": "Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents."
        },
        "example": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Illustrative entries shown in fill forms and used when a template is previewed with examples. Never written to output."
        },
        "maxItems": {
          "type": "integer",
          "minimum": 1,
          "description": "The most entries the list may have. Checked on the declared value and on a value given to a fill; a longer list is the warning opf/variable-overflow. Fill forms and models read it before writing."
        },
        "translations": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/LanguageTag"
          },
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "value"
            ],
            "properties": {
              "value": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "minProperties": 1,
          "description": "The entries in other languages, keyed by language tag, each entry a 'value' list. Where the variable is drawn, the slide's declared language (else the deck's) selects an entry: the exact tag, then the tag with its last subtag removed, and so on ('de-AT', then 'de'), compared without regard to case; no match draws 'value'. A language read from the text does not select one. A fill that gives the variable a new value without translations removes them."
        }
      },
      "description": "A list of strings, for bullets and list items. A whole-string array element 'var:<id>' splices every entry into the array in place; a whole field 'var:<id>' becomes the array; '{{<id>}}' joins the entries with ', ' (or the separator after a pipe: '{{<id>|; }}')."
    }