Hi, I have added a user macro to Confluence which will be frequently used by our staff. I would like to add it to the insert menu (in the featured macros section?) so that it can be used without opening the macro browser and locating it each time. Is this possible?
Hi Greg,
For adding full blown macro plugins to the insert menu there's documentation available at https://developer.atlassian.com/display/CONFDEV/Plugin+points+for+the+editor+in+4.0 I'm not sure if you can reference a user macro in a Web Item though as I've never tried to do this.
Hope that's of some help as a starting point??
Andrew.
Thanks Andrew, I don't think there's the easy way I hoped for to do this. Putting a plugin together seems like overkill, but it might be the only way!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
This might be easier than I thought by just using the above link to create a plugin that just creates the menu item, but referencing the key of the user macro rather than having to convert the user macro to a macro plugin. Testing it now to see if it works.
Andrew.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep it works with user macros, amazing what some sleep followed by caffeine can do :-)
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}" /> </plugin-info> <web-item key="editor-my-macro" name="Insert Last Login MAcro" section="system.editor.featured.macros.default" weight="100"> <label key="Last Login Macro"/> <link linkId="lastlogin"/> </web-item> </atlassian-plugin>
In the above example I tested with a user macro that I had created called "lastlogin" so just replace the label key and linkid with values that match your user macro.
7. Type atlas-run to run up a test instance of Confluence including the new item
8. Add you user macro to the test instance
9. Test that the menu item works
10. Run atlas-package to package your plugin so it can be installed on your real Confluence instance
NB. The macro browser only works with macros that have parameters so if your user macro does not have parameters that the user has to enter it won't work with the macro browser in general let alone via the new menu item.
Hope that makes sense? A bit of a rushed set of instructions as I need to head out, but I'll blog a more detailed solution and post it later.
Andrew.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Brilliant, followed your instructions and got it working, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.