Descriptions for fields in macro plugin

Dave Bosman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2018

Hi all, 

We have a few user macro"s and we want to put them in a plugin for versioning reasons. 

So i followed the tutorial https://confluence.atlassian.com/conf210/confluence-development-hub/confluence-plugin-guide/writing-confluence-plugins/confluence-plugin-module-types/user-macro-plugins

I also managed to get fields for configuration in there with the parameter tag (although this is poorly documented) and everything works as expected.

<user-macro name='macro-name' key='this-is-my-key' hasBody='false' bodyType='raw' outputType='html'>
<description>My macro</description>
<category name="media"/>
<parameters>
<parameter name="Url" type="string" default="" required="true" label="test"/>
<parameter name="Size" type="enum" default="" required="true">
<value name="Small"/>
<value name="Medium"/>
<value name="Large"/>
<value name="Custom"/>
</parameter>
<parameter name="Width" type="int" default="" required="false"/>

</parameters>
<template>

<![CDATA[

And here the user macro......

]]>

</template>

</user-macro>

 

However i am unable to add a description to these fields. All help would be greatly appreciated. 

 

Regards

Dave

1 answer

1 accepted

1 vote
Answer accepted
Dave Bosman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2018

I found the solution myself. 

Add a resource type i18n to your plugin 

 <resource type="i18n" name="i18n" location="location and name of your properties file"/>

add a properties file with following values. 

groupid.artifactId.macro-name.param.param-name-from-macro.label=the label above your field

groupid.artifactId.macro-name.param.param-name-from-macro.desc=the description for the field

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events