So I'm trying to add parameter fields to the macro created from following this -> https://developer.atlassian.com/display/CONFDEV/Creating+a+New+Confluence+Macro tutorial.
From what I gathered I should add the parameters in the atlassian-plugin.xml like so:
<xhtml-macro name="tutorial-confluence-macro-demo" class="com.example.plugins.tutorial.confluence.ExampleMacro" icon="/download/resources/${project.groupId}.${project.artifactId}/images/browserLogo.png" key="my-macro"> <parameters> <parameter name="issueKey" type="String" required="true" /> </parameters> </xhtml-macro>
And there should be a visible parameter field when I select the macro and try to add it, but as you can see - there isn't. What am I doing wrong? I read something about having to add javascript and/or i18n label + description, but I have no idea where and how to do that. Can someone please explain what I have to do to achieve my goal?
Community moderators have prevented the ability to post new answers.
So after some research, watching some videos and reading some slides from atlassiancamp and going through bitbucket to search for some examples I found where the problem was.
For the parameter to have a visible field and a label/description you need to add some information in the internationalisation file (i18n), the location of which you can check in the atlassian-plugin.xml file, for example:
<!-- add our i18n resource --> <resource type="i18n" name="i18n" location="confluence-clientinfo-plugin" />
groupID.artifactID.macroKey.label=The Name of the macro groupID.artifactID.macroKey.desc=The Description of the macro groupID.artifactID.macroKey.param.paramName.label=Some Label (this is what you need to make your parameter field visible) groupID.artifactID.macroKey.param.paramName.desc=Some Description
I hope this saves inexperienced people like me some time.
Here are links to the sources I used to figure this out:
http://www.slideshare.net/GoAtlassian/pimp-my-confluence-plugin-atlascamp-2011
https://www.atlassian.com/en/company/about/events/atlascamp/2010/day2/making-confluence-macros-easy
And an example of a confluence macro:
https://bitbucket.org/rthomas/confluence-status-macro/src/3c01673e130c?at=default
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.