It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Customize Confluence editing toolbar

Is it possible to customize the editing toolbar in Confluence? We use the Code macro very often and I'd like to have a button in the toolbar instead of having to open Insert --> Other Macros and search for the Code macro.

2 answers

One good workaround is to hit left open curly brace `{` and then start typing the name of the command, e.g. `{code` for code blocks. This opens a filter dropbox which you can then navigate with Up, Down, Enter or the mouse.

You can hack it with jQuery.

Add the following to your Custom HTML:

<!-- Replace "Table of Contents" macro in editor's "Insert" drop down list with "Code" -->
AJS.$('a#toc.item-link').attr('title','Insert Code macro');

The key is the data-macro-name. Setting that to "code" invokes the macro browser and selects the Code macro automatically.

Note: I tried to use append() to add a new macro to the end of the list, but could not get it working. Maybe someone can step in and debug this?

AJS.$('#macro-insert-list').append('<li class="dropdown-item macro-toc" data-macro-name="code"><a id="code" class="item-link" title="Insert \'Code\' macro" href="#"><span class="icon "></span>Code</a></li>');

BTW, this is on Confluence 4.2.3. If you have a different version of Confluence, the style names might be slightly different.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 18, 2019 in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

377 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you