How can I choose which macros appear in the + dropdown?
Asked by Adam Humenansky:

We are on Confluence Server 7.2 and we recently started using the "Excerpt" macro more frequently.

When adding a macro to a page, we use the + button, which gives a long list of macros, and the additional option for "Other Macros."

I would like to be able to add the macro "Excerpt" onto the dropdown (potentially replacing one of the others, if necessary), thus removing the need to open the macro browser. Is that possible?


Answers:
author: Bill Bailey
body: An oft requested feature. The only ways I know of that it can be done are via Javascript or writing your own plugin to add it to the menu, something along the lines of this tutorial:

<https://developer.atlassian.com/server/confluence/adding-an-option-to-the-editor-insert-menu/>

I have used the later method to add some user macros to the insert menu.

comments: author: Adam Humenansky
body: Thank you for the response. That's a great, detailed response that could provide an avenue to our solution.

Reading through the documentation, that looks to be a way to add an icon to the Confluence page editing menu, is that correct?

That may be the only way to achieve the effect we're trying to get, and it will definitely work (based on my reading of the link you provided). I was hoping for a lighter-weight solution to modify the specific macro menu, instead of the editor.

I apologize if I overlooked this capability in the link above (and for asking a repeated question!). Thank you for your time and assistance-


author: Bill Bailey
body: There are limited attach points. You specify them in the web-item module (setcion attribute), for example:

```
 <web-item key="editor-figuretitle" name="Figure Title" section="system.editor.featured.macros.default" weight="13">
<description>Editor Insert menu link.</description>
<label key="editor-figuretitle.label"/> 
<link linkId="figure_title"/>
</web-item>
```

But yes, a feature to be able to promote a macro to the featured list would be great, and has been asked for for years (soon to be 10). ;-) [CONFSERVER-23368](https://jira.atlassian.com/browse/CONFSERVER-23368?error=login_required&error_description=Login+required&state=c3c5e2bb-d4cf-4f23-9859-c0fa397f3f1a)


author: Adam Humenansky
body: Extraordinary help, thank you. Added my vote and watched that link!


author: Nishant_upadhyay
body: Hi [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089)

I'm also trying to list my macro under Insert menu bar . I tried using your web-item configuration as mentioned in above comments.

My macro is getting added in Insert menu toolbar but it is appearing below symbol macro as mentioned in attached snapshot. I tried to look into inspect option for insert menu toolbar , got to know that it is divided into two section like "content-insert-list" and "macro-insert-list". I want to add my macro at first position like above "Files and Image" macro . Could you please help to tell what value of section i need to pass to achieve this ?

Here is my web-item configuration .

```
<web-item key="editor-macrolinkkey" name="Name of my Editor Feature" section="system.editor.featured.macros.default" weight="-91">
    <label key="Insert Link file"/>
    <link linkId="insert-link-file"/>
</web-item>
```

![image (37).png](https://community.atlassian.com/t5/image/serverpage/image-id/217935i9B1E4F1ACBA283D9/image-size/large?v=v2&px=999 "image (37).png")![image (38).png](https://community.atlassian.com/t5/image/serverpage/image-id/217936i2B45A96C8B07BA78/image-size/large?v=v2&px=999 "image (38).png")


author: Bill Bailey
body: Hi, the placement is controlled by the weight (what you show is weight -91). For my macros, I used weights 12 and 13 to place them middle of the pack. So experiment with a higher positive number.

BTW, weight is a classic UI parameter for menus.


author: Nishant_upadhyay
body: Hi [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089)

Thanks for looking into it. I tried multiple combination of weight values even with 0 value but I'm not able to move my macro at first position. I want to list my macro at the place before "Files and images" macro is listed .

I also tried weight value as higher positive number but that is placing the macro to end of the pack. But I want to place at in the start of pack .

Thanks

Nishant


author: Bill Bailey
body: you tried a weight of 99?


author: Nishant_upadhyay
body: Yes. I've tried it. But Unfortunately , Using weight value of 99 is going to put my macro at the second last position of the list.


Tags: confluence-server

server