It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence User-Macro renders in preview but not in page

I have a usermaro which renders in the preview of the macro, but not after savig.

It has links to external scripts and stylesheets. Is that the problem? Or is there an other reason?

Once again: in the preview pane of the macro, i works perfectly fine!

2 answers

0 votes

Hello Andrew,

This is an interesting behavior. Was this tested in the latest confluence version? Do it works on other confluence instance or just this one? Is there any error appearing in the page after saving it?

Maybe you could provide an example of the custom macro code so we can perform some tests?



Hi Rodrigo,

It's on Confluence 4.3

I haven't checked on other instances.

there were some minor errors, but nothing alarming.

the scripts for the example is scattered among internal servers, which is quite some work to assemble.

What happens is that we link to javascript from outside sources, and it seems that those work in the preview, but not "normally"

Sorry it's vague. I'll try to create a more simple example.

body {

margin: 20px 20px 20px 20px;

text-align: center;

font-size: 13px;

font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;


#calendar {

width: 100%;


.fc-weekend {

color: grey;


.fc-weekend-column {

background-color: silver;


.greenEvent {

background-color: green !important;

color: grey;


.timeline {

position: absolute;

left: 59px;

border: none;

border-top: 1px solid red;

width: 100%;

margin: 0;

padding: 0;

z-index: 999;


.OOF {

background-color: silver;

color : black;


.concentratie {

background-color: #ABBDDC;

color : black !important;


.tentative {

color : white;

background-image: repeating-linear-gradient(135deg, transparent, transparent 10px, rgba(255,255,255,.2) 10px, rgba(255,255,255,.2) 20px);


.thuis {

background-color: #DDDDDD;

color : black;




<p><div id='calupdate' style="text-align: left !important; color: silver;"></div></p>

<div id='calendar'></div>

<div id='contextMenuContainer' style='background-color:#f0f0f0;width:100px;height:100px;display:none;z-index:999;border-radius:5px;border:1px solid black;position:absolute;'></div>]]></ac:plain-text-body>


Maybe this helps?

It's in the user macro.

## Macro title: Exchange Agenda

## Macro has a body: Y

## Body processing: Rendered

## Output: HTML


## @paramurl:title=URL|type=string|required=true|desc=URL of API|default=.

## @paramuser:title=Gebruiker|type=string|required=true|desc=korte naam|default=NOUSER

#set( $user = $userAccessor.getUser($paramuser) )

#set( $user_src = "&g=" + $paramuser )

#set( $url = $paramurl )

<ac:macro ac:name="html">

<ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>


<link href="$paramurl/fullcalendar/fullcalendar.css" rel="stylesheet" />

<link href="$paramurl/fullcalendar/fullcalendar.print.css" rel="stylesheet" media="print" />

<link href="$paramurl/jquery/jquery.qtip.min.css" rel="stylesheet" />

<script src="$paramurl/jquery/jquery-1.9.1.min.js"></script>

<script src="$paramurl/jquery/jquery.qtip.min.js"></script>

<script src="$paramurl/jquery/jquery-ui-1.10.2.custom.min.js"></script>

<script src="$paramurl/fullcalendar/fullcalendar.js"></script>

<script type="text/javascript" src="$paramurl/index2.php?js$user_src"></script>


Hello Andrew,

i had the exact same Problem. The Javascript part of my Plugin was renderd in Preview Mode just fine but not once it was save to the Site.

There is a workaround for that issue.

In my .vm file i included

#if ($req.getRequestURI().contains("tinymce"))
    #elseif ($req.getRequestURI().contains("rendercontent.action"))

I just call my update function everytime the Macro URI changes from preview to saved state etc.

I hope this will help you




Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Thursday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

114 views 0 10
Read article

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