User Macro doesn't appear in the Macro Browser

Deleted user May 28, 2014

I asked this question some time ago but was unable to test it until now. This is Confluence 5.0

I built the macro as shown. It works perfectly well, but isn't appearing in the Macro Browser. In the macro editor, these settings are ticked or selected:

  • Visible to all users in the Macro Browser
  • Category = Navigation
  • Macro icon = blank (is this necessary?)
  • Documentation url = a page in our wiki, written as a full url eg

    http://mywiki.com/display/spacekey/wiki+page
  • Macro Body Processing = rendered

I've had a dig through the documentation including this nice page: Including Information in your Macro for the Macro Browser but I don't see anything helpful there.

(Interestingly my original old macro that does the same thing also continues to work even though it has a red flag against it. It doesn't appear in the Macro Browser either. )

 

(Minor edit: fixed the documentation url)

1 answer

1 accepted

2 votes
Answer accepted
Rand McKinney July 18, 2014

I discovered a bug in Confluence 5.5.2 where if your user macro doesn't have any parameters, it will not show up in the Macro Browser. I didn't check Jira to see if this had been already reported. But you can workaround it by adding a "dummy" parameter to your macro.

For example, the following macro will NOT appear in macro browser:

## Macro title: Next Step
## Macro has a body: Y
## Body processing: Rendered
##
## Developed by: C. Rand McKinney
## Date created: 18 July 2014
## Installed by: C. Rand McKinney
<div style="font-size: 11pt; font-weight: bold; border: 1px solid #cccccc; background-color: #EBF5EB; padding: 10px; border-radius: 3px; margin: 10px 50px 10px 50px;">
$body
</div>

But if you add a "dummy" parameter as follows, it will appear in macro browser:

## Macro title: Next Step
## Macro has a body: Y
## Body processing: Rendered
##
## Developed by: C. Rand McKinney
## Date created: 18 July 2014
## Installed by: C. Rand McKinney
## @param Name:title=Reviewer Name|type=string|required=false|desc=Your name 
<div style="font-size: 11pt; font-weight: bold; border: 1px solid #cccccc; background-color: #EBF5EB; padding: 10px; border-radius: 3px; margin: 10px 50px 10px 50px;">
$body
</div>

Deleted user July 23, 2014

Thank you. Sorry for the delay in replying. I can't test this out right now (test system was deleted, upgrade is still pending). I'll revisit this as & when and let you know if it works for me or not.

Stephen Deutsch
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 23, 2014

You don't necessarily have to create a dummy parameter, you can instead include the following line at the top of your user macro:

## @noparams

This will also prevent an error message from showing in the user macro browser.

Deleted user August 6, 2014

Thanks, Rand & Stephen -- it's working AND appears in the macro browser.

Ian Hametz December 5, 2015

Thanks Rand and Stephen. I had the same problem and it was driving me nuts for weeks. You guys saved the day!

Pavel Potcheptsov
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.
May 12, 2016

Neither adding

## @noparams

nor

## @param Name:title=Reviewer Name|type=string|required=false

in 5.9.x doesn't help to display User Macros in specified category of Macro Browser.

It is possible to find such macros only by searching by macros name.

Like Gonchik Tsymzhitov likes this
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 27, 2018

Thanks for this helpful info! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events