Macro Property Panel

On This Page

    Defining a Macro Property panel allows you to add a hidden iframe to your macro's property panel. The iframe is loaded as soon as the property panel is opened.

    In order to persist custom data using your property panel, use the Javascript Confluence API. For example:

    AP.require(["confluence"], function (confluence) { var macroParams = { myParameter: value }; confluence.saveMacro(macroParams); });

    In order to retrieve the custom data again when the property panel is opened, use confluence.getMacroData (see Confluence API):

    AP.require("confluence", function (confluence) { var macroData = confluence.getMacroData(function(macroParams) { doSomethingWith(macroParams.myParameter); }); });

    Dialogs may also be created. Use dialog.create (see Dialog API):

    AP.require('dialog', function(dialog) { dialog.create({ key: 'my-module-key', width: '500px', height: '200px', chrome: true }).on("close", callbackFunc); });

    Properties

    url
    Type
    string
    Format
    uri-template
    Required
    Yes
    Description

    The URL of the add-on endpoint which will be served as a hidden iframe inside the property panel


    cacheable
    Type
    boolean
    Defaults to
    false
    Description

    Returns whether the URL should be cacheable. Cacheable URLs are taken directly from the add-on descriptor, and lack all additional query parameters:

    • standard iframe query parameters
    • product context parameters
    • JWT token


    controls
    Type
    [TextControl, ControlGroup, ToggleGroup, ButtonControl, ...]
    Description

    List of controls which will be added to the macro property panel


    Rate this page: