Troubleshooting Macros in the Page Gadget
Macros were originally designed to only be used in a Confluence instance. Rendering macros in the Confluence Page Gadget outside of a Confluence instance can result in minor quirks that require some workarounds to resolve. Please note, the workarounds described below are written for users who are confident developing in Confluence. Do not attempt any of the procedures below, if you do not have any experience in this area.
Please see the Confluence Page Gadget documentation for the full list of working/non-working macros.
On this page:
My AJAX call isn't executing my callback
The page gadget uses a proxy to execute AJAX requests back to Confluence. This means that, in some cases, an AJAX call that previously worked in Confluence may not work in the page gadget.
If you include an error handler like this:
You may see the following error:
This generally occurs when your action returns raw html, while the page gadget expects JSON by default. To fix just add the following to the ajax call.
- Page tree
Some links are not being directed back to Confluence
- Advanced Macros (recently updated)
- Page tree
The gadget isn't resizing
As in the previous section, the page gadget needs to be notified when the page has increased/decreased in size. Executing the above code will also ensure that the page content fits into the page gadget.
I want the macro to render differently in the Page Gadget
Sometimes you would like to render a completely different view in the page gadget. To achieve this you can use the Page Gadget render type
com.atlassian.confluence.renderer.ConfluenceRenderContextOutputType#PAGE_GADGET. This render type notifies the macro that it is being rendered in the context of a page gadget. This method is used when rendering the tasklist and gadget macros.
- Attachments Macro
I would like to style my macro/theme differently in the Page Gadget
In the gadget iframe we have included:
So if you would like to style your macro or theme specifically for the page gadget you can use the
- Easy Reader Theme