Forums

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

User Macro doesn't work different Confluence versions.

Daniel Westberg August 10, 2014

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

1 vote
Answer accepted
Kirstin Seidel-Gebert
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.
August 11, 2014

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.

Daniel Westberg August 11, 2014

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?

Daniel Westberg August 11, 2014

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?

0 votes
Kirstin Seidel-Gebert
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.
August 11, 2014

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

0 votes
Kirstin Seidel-Gebert
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.
August 11, 2014

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

Daniel Westberg August 11, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events