Using a macro to insert Wiki Markup

Hi, as a newbie to Confluence user macros and to Wiki Markup, I am trying to create a user macro which would display a image based menu within the page.

I can do it manually for each menu item using an excellent user macro (which I didn't create) called image-rollover. The Wiki Markup is:

{image-rollover:https://address.domain.com/download/thumbnails/36112712/windy.png|https://address.domain.com/download/thumbnails/36112712/windsock.png|36113221|_self}

What I would like to do is to maintain multiple lines like this, each using different images and containing a different pageid. Then allow editors to simply insert the macro to the top of a page.

My theory is that the menu in each page would be dynamically updated if the parent user macro was updated, but I haven't been successful in creating a user macro that works, even for a single menu item.

Here is the link to the image-rollover macro: https://confluence.atlassian.com/display/DISC/Image+rollover

Any help would be very much appreciated.

Thanks

1 answer

I solved it, and here is what I did:

## Macro title: Information Security Menu

## Macro has a body: Y

## Developed by: Jon Lake

## Date created: 19/07/2014

## Installed by: Jon Lake

## @noparams

#set($globalHelper = $action.getHelper())

#set($renderedhtml = $globalHelper.renderConfluenceMacro("{image-rollover:https://mydomain.com/download/attachments/36112712/windsock.png|https://mydomain.com/download/thumbnails/36112712/windy.png|16450120|_self}"))

$renderedhtml

#set($globalHelper = $action.getHelper())

#set($renderedhtml = $globalHelper.renderConfluenceMacro("{image-rollover:https://mydomain.com/download/thumbnails/36112712/x.png|https://mydomain.com/download/thumbnails/36112712/zoomin.png|16450120|_self}"))

$renderedhtml

#set($globalHelper = $action.getHelper())

#set($renderedhtml = $globalHelper.renderConfluenceMacro("{image-rollover:https://mydomain.com/download/thumbnails/36112712/weather.png|https://mydomain.com/download/thumbnails/36112712/upload.png|16450120|_self}"))

$renderedhtml

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,121 views 17 14
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