Confluence Macro: Adding a description to the parameters

Hi together,

I am trying to add a description to my configuration parameters of my confluence macro/plugin but I don’t know how. I can see on other configuration pages, that this seems to be possible…

Example:
image

How to add this to the atlassian-plugin.xml?

    <xhtml-macro name="agiletimer" class="whatever.AgileTimer" key='agiletimer-macro'>
        <description key="agile.timer.macro.desc"/>
        <category name="formatting"/>
        <parameters>
            <parameter name="TimerID" type="string" required="false" default="add 5 random digits here to save the time configured"/>
            <parameter name="Width" type="string" required="true" default="280"/>
            <parameter name="Height" type="string" required="true" default="550"/>
        </parameters>
    </xhtml-macro>

Thanks for your help!!

First you will need to add an i18n resource to your plugin xml that points to a .properties file, e.g.

<resource type=“i18n” name=“i18n” location=“plugin.properties”/>

Then in the same directory where your plugin xml lives, create the plugin.properties file.

Then for each parameter name in your macro, add a property using the fully qualified path of your plugin, e.g.

com.example.my-plugin.agiletimer-macro.param.TimerID.label=Timer ID
com.example.my-plugin.agiletimer-macro.param.TimerID.desc=Your description of TimerID goes here

Hope this helps.

1 Like

Hi Scott,

thanks for the fast response, yes that helped a lot!! The only thing I needed to change to get it work is the key within the properties file. You used the xhtml-macro-key (“agiletimer-macro”) which somehow did not work for me. I needed to use the xhtml-macro-name (“agiletimer”).

key = {xhtml-macro-classpath}.{xhtml-macro-name}.param.{parameter-name}.desc

so in my case of the example above it would be:
whatever.AgileTimer.agiletimer.param.TimerID.desc = add 5 random …

1 Like