Forums

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

User Macro stopped working after update to v7+

Jeff
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 4, 2021

This macro was working on 4.13 until our sysadmin just updated to 7.x.

I've been stumped as to why it is not working any further. Any help would be appreciated.

The macro essentially renders out one of three HTML buttons. But now this code is not working:

## Macro title: Button Generator
##
## @Param url:title=URL|type=string|desc=Insert URL
## @Param label:title=Label|type=enum|enumValues=Download,Search|default=Download
## @Param ext:title=External?|type=boolean|desc=Is this link external?|default=false
##
## Set icon value dependent on purpose value
#if ($paramlabel=="Download")
#set ($icontype="fa-cloud-download")
#set ($btnclr="download-color")
#elseif ($paramlabel=="Search")
#set ($icontype="fa-search")
#set ($btnclr="search-color")
#end

## REPLACE ICON IF EXTERNAL
#if ($paramext=='true')
#set ($icontype="fa-external-link")
#end

<span class="confluence-embedded-file-wrapper confluence-embedded-manual-size">
<a href="$paramurl"><button class="btn $btnclr"><i class="fa $icontype"></i> $paramlabel</button></a>&nbsp;
</span>

1 answer

0 votes
Bill Bailey
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.
October 4, 2021

Have you checked the logs (need admin rights) to see what errors it is throwing?

And are you sure that the CSS classes you are refernecing are still available? It has been quite some time since Version 4 (I think 10 years).

Jeff
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2021

Thanks, Bill. I have checked the logs and it's not throwing any errors that I can see.

The CSS classes are still there since the existing usages of the user macro are still displaying correctly. It's only when we try to add a new user macro under 7.x that it's not displaying correctly.

I suspect it has to do with some syntax changes or security tightening that my current code doesn't account for.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events