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

marco polo July 26, 2012

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

0 votes
Amalia
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.
July 27, 2012

You can view velocity templates of most bundled macros by going to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup and opening atlassian-bundled-plugins.zip. 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:

marco polo July 28, 2012

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 Sign up to answer