Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using a macro to insert Wiki Markup

Jonathan Lake July 17, 2014

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

1 vote
Jonathan Lake July 18, 2014

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
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events