Confluence: Where can the Velocity Markup for Atlassian Macros be referenced?

I would like to know where I can find the Velocity markup for Atlassian macros, like the TOC Macro, so that I can create new custom versions.

Can someone point me to the section of Confluence documentation that contains these macro scripts?

This has become more important than ever now that the use of wiki markup in User Macros (custom) is no longer supported in 4.x

1 answer

You can view velocity templates of most bundled macros by going to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup and opening Most macros are located in confluence-advanced-macros-x.x.xx.jar file. You can find the the templates there.

For TOC, the plugin is under the name toc-plugin-x.x.xx.jar file but there are no Velocity template files that are used to display the TOC.

You can also use Confluence Source Editor to see the macro's XHTML output.

Hopefully these examples are helpful:

Thank you for your answer and the supplied references. I realize now I should have mentioned that we're in the proces of upgrading our Confluence 3.4 version, so on the development server we're runnning Confluence 4.0, and I'm trying to figure out how to upgrade all the custom User Macros that often have many other macros (and other wiki markup) in them...

The simplest user macros we have I'm converting to HTML, but many user macros in page templates (not for common editors via macro editor) that incorporate functinoality from other embedded macros in the user macros, I am thinking that I will move them into widgets ( ~ portals) that are part of the Community Bubbles plugin, Using widgets and portals initiates a lot of work for the macros that are in content areas that need to be renamed as bubbles-widget - for many pages in one documentation space we have a header and footer import macro on each page, so these will likely have to become bubble-widgets

- although for other macros, I want to keep accesible for editors in macro editor - if I can reference the original velocity markup for some macros I think I could modify/remake a new custom user macro in velocity and keep the benefits for editors of using macros.

QUESTION: >> The TOC macro is one macro I need to create a new customized version adding a div wrapper to clearly attach an ID/class to it for CSS styles and javascript. HOW BEST TO DO THIS?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,316 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot