Providing an Image as a Macro Placeholder in the Editor
|Status:||LEGACY This tutorial applies to Confluence versions that have reached end of life.|
As of Confluence 4.0 a plugin developer can specify an image to use as a macro placeholder in the editor, rather than the placeholder image itself. This is only applicable to macros without a body.
The image provided can come from anywhere within the current Confluence context, it can be a static image or dynamically generated by your plugin.
In order to make use of this feature you must edit your plugin and implement the
For this we will use a new cheese macro that renders a static image of cheese both in the editor and when it is executed.
For this example we are just referencing a resource we are providing in this plugin, the cheese.jpg file:
The String referenced in the
ImagePlaceholder should be relative to the confluence base url, the editor will automatically make sure that this points to the correct url. Absolute URLs are not supported for this feature.
The image rendered in the editor as the placeholder will behave just like a regular bodyless marco placeholder, the property panel will still function correctly and the user will be able to edit it just like a macro. Any parameter changes in the macro browser will cause the image to be reloaded - so that changes can be seen.
ImagePlaceholder interface is described below