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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

374 views 20 10
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