How can I choose which macros appear in the + dropdown?

Adam Humenansky June 2, 2021

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?

1 answer

1 accepted

1 vote
Answer accepted
Bill Bailey
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.
June 2, 2021

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.

Adam Humenansky June 3, 2021

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-

Bill Bailey
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.
June 3, 2021

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 

Adam Humenansky June 3, 2021

Extraordinary help, thank you. Added my vote and watched that link!

Nishant_upadhyay September 27, 2022

Hi @Bill Bailey 

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).pngimage (38).png

Bill Bailey
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.
September 29, 2022

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.

Nishant_upadhyay September 30, 2022

Hi @Bill Bailey 

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

Bill Bailey
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.
September 30, 2022

you tried a weight of 99?

Nishant_upadhyay October 1, 2022

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. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events