Image Placeholder

Defines a macro image placeholder to display in the Confluence editor.

Example

1
2
3
4
5
6
7
8
9
{
  "imagePlaceholder": {
    "width": 100,
    "height": 25,
    "url": "/images/placeholder.png",
    "applyChrome": true
  }
}

Properties

url
Type
Format
uri
Required
Yes
Description

The URL of the image placeholder. Your image placeholder needs to be hosted remotely at a web-accessible location. You can specify the URL as an absolute URL or relative to the add-on's base URL.

The url here doesn't support context parameters. However all the macro parameters will be passed as query parameters to the request.
You can use these parameters to dynamically generate the placeholder image.

Suppose you have a macro defined like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "dynamicContentMacros": {
    "renderModes": {},
    "url": "/my-macro",
    "categories": [],
    "outputType": "block",
    "bodyType": "none",
    "aliases": [],
    "parameters": [
      {
        "identifier": "param1",
        "name": {
          "value": "Parameter 1"
        },
        "type": "string",
        "required": false,
        "multiple": false,
        "hidden": false
      },
      {
        "identifier": "param2",
        "name": {
          "value": "Parameter 2"
        },
        "type": "string",
        "required": false,
        "multiple": false,
        "hidden": false
      }
    ],
    "imagePlaceholder": {
      "url": "/images/placeholder.png",
      "applyChrome": false
    },
    "name": {
      "value": "My macro with placeholder"
    },
    "key": "my-macro-key"
  }
}

The Confluence editor will pass the parameter values when requesting the placeholder image: /images/placeholder.png?param1=value1&param2=value2


applyChrome
Type
Defaults to
false
Description

Set to true if the image should have the macro placeholder chrome applied to it.


height
Type
Description

The height in pixels of the image placeholder. Defaults to the natural image height if not specified.


width
Type
Description

The width in pixels of the image placeholder. Defaults to the natural image width if not specified.