User Macro doesn't work different Confluence versions.

Hi,

I created this user macro that create stamps, red text with borders, and it works fine in Confluence 5.5.3 but when I try it on Confluence 5.4.3 it doesn't work. I need it to work on 5.4.3. What can i change?

Any help is appreciated!

Template:

## Macro title: Stamps
## Macro has a body: N
## Developed by: Daniel Westberg
## Date created:08/04/2014
## Installed by: 
## Create stamps.

## @param Mode:title=How do you wanna do this?|type=enum|enumValues=load,create|default=load| desc=Choose a mode.
## @param ExportControll:title=EXPORT CONTROLLED ?|type=enum|enumValues=Yes,No,Unset|default=Unset
## @param Stamps:title=Stamps|type=enum|enumValues=secret1,secret2,secret3|default=secret1|desc=Pick a stamp.
## @param Title:title=Create Title|type=string|desc=Title if you create a stamp.
## @param Text:title=Create Text|type=string|desc=Write text if you create a stamp.
## @param Sign:title=Sign|type=string|desc=Write your sign
## @param Date:title=From Date|type=date|desc=Date to start from. Format: dd/mm/YYYY 

## Load a stamp mall or create your own
#if($paramMode=="load")

## Decide which mall you want to use, Mall 1
#if($paramStamps=="secret1")

<div id="secretlevel1" style = "text-align:center; border: solid 5px red; color : red; width : 200px;">
<h1 style= "color: red">Test1</h1>
Text1
$paramDate <br>
Text1 <br>
</div>

## Mall 2
#elseif($paramStamps=="secret2")
<div id="secretlevel2del1" style = "text-align:center; border: solid 5px red; color : red; width : 300px;">
<h1 style= "color: red; size: 16;">Test2</h1>
</div>
<div id="secretlevel2del2" style = "text-align:center; border: solid 5px red; color : red; width : 300px; ">
Test2
Datum: $paramDate <br>
Sign: $paramSign
</div>

##Mall 3
#elseif($paramStamps=="secret3")
<div id="secretlevel3" style = "text-align:center; border: solid 5px red; color : red; width : 200px;">
<h1 style= "color: red">Test3</h1>
Test3
<h1 style= "color: red">Test3</h1>
</div>
#end

#elseif($paramMode== "create")
<div id="secretlevel2del1" style = "text-align:center; border: solid 5px red; color : red;">
<h1 style= "color: red">$paramTitle</h1>
</div>
<div id="secretlevel2del2" style = "text-align:center; border: solid 5px red; color : red;">
$paramText
</div>
#end

## Add an Export label
#if($paramExportControll== "Yes")
<div id="s1" style = "text-align:left; color : green;">
<Strong> EXPORT
</div>
#elseif($paramExportControll== "No")
<div id="s2" style = "text-align:left; color : red;">
<Strong> NOT EXPORT
</div>
#end

/Daniel

3 answers

1 accepted

Are you explicitly supplying Mode=load or are you relying on the default? I had problems myself in user macros with the default not being set correctly.

Yes, the Mode=load seem to be set correctly. When I set Mode=create all is fine, and the entire macro works in 5.5.3 which I think it wouldn't if the Mode=load wasn't set correctly. I'm thinking there might be something in the mall1-3 code that 5.4.3 can't handle?

I visited the administrator for the 5.4.3 system and you were right! The param is for some reason unable to get the default value. I solved it by adding an Unset-default value for each param. Is this something they fixed for the 5.5.3 system?

Hello Daniel,

it would be helpful, if you gave some hints what's not working. Have you tried to debug it by inserting some additional output to e.g. verify the value of the parameters?

Regards,
Kirstin

Hi Kirstin,

Currently what's not working is previewing and creating mall1-mall3. When I try to create them in 5.4.3 the macro doesn't show. Debugging with additional output is a good ide but I am not administrator of the 5.4.3 system which makes the process cumbersome.

Cheers,

Daniel

Could Confluence have Problems with <br>? What if you tried <br />?

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 ...

562 views 20 11
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