Custom Macros
Use this feature to create your own macros.
To see examples of custom macros, check out these pages:
Choose a macro type
Static Content macros render directly in the page and use the page's styling.
Dynamic Content macros render in their own i-frame, separate from the page, and you can customize them with CSS and JavaScript.
Say you're building a Confluence page where people sign up for a company picnic.
To show a list of who's bringing which food, pulled from another Confluence page, use a Static Content macro.
To show the weather forecast from an external website, in a block element, use a Dynamic Content macro.
You can use the CSS field to create custom styling, like displaying the temperature in an italic, blue font.
You can use the JavaScript field to add custom behaviors to the macro, like a button that would toggle the temperature reading between Farenheit and Celcius when clicked.
Comparison table
| Static Content Macro | Dynmaic Content Macro (default) | |
|---|---|---|
| Best for | Show Confluence content so it looks like part of the page | Show external content, or output that needs custom styling or behavior |
| Formatting | Inline | Block |
| Where it renders/where data is stored | Directly in the page | In its own i-frame, separate from the page |
| Styling | Uses the page's styling | Doesn't use the page styling. Custom CSS applies only inside the i-frame. |
| CSS and JavaScript | Not available | Optinal CSS and JavaScript fields appear when this type is selected |
| External URLs | Do not render; display as plain text | Load after the page, so users may briefly see a loading state |
| Performance | - | Each macro loads in its own i-frame; rendering multiple on a single page can cause performance issues. A page with 100 Dynamic macros loads 100 i-frames, which uses a lot of resources* |
* If a macro will appear many times on one page, such as a template or table row, use Static Content macros as much as possible.
Notes for all macro types
All URLs must match Runtime egress permissions.
Updates to custom macros aren't always reflected immediately in the output.