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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

910 views 23 12
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