This Confluence Cloud macro creates a page-break element used for print and PDF export scenarios while preventing unnecessary space during macro preview rendering. It detects the current render output type using $renderContext.outputType and, when running in preview mode, hides the page-break container, removes margins and dimensions, collapses the iframe body to zero height, and calls AP.resize() to eliminate blank space and avoid significant layout gaps in the editor preview.
#set($outputType = $renderContext.outputType)
<div
id="vlt-page-break"
style="page-break-before: always;"
>
​
</div>
<script>
AJS.toInit(function() {
const outputType = "$!outputType";
const wrapper = document.getElementById("vlt-page-break");
if (outputType === "preview") {
wrapper.style.display = "none";
wrapper.style.height = "0px";
wrapper.style.minHeight = "0px";
wrapper.style.margin = "0";
wrapper.style.padding = "0";
wrapper.style.overflow = "hidden";
document.body.style.height = "0px";
document.body.style.minHeight = "0px";
AP.resize("0px", "0px");
setTimeout(() => AP.resize("0px", "0px"), 100);
return;
}
});
</script>Display Confluence page edit and view restrictions to provide essential permission details, including users, groups, and inherited access
Show an expandable page tree for a selected parent page, defaulting to the current page
Allow users to retrieve all pages from the current space despite the 250-page limit per request
Generate IDs in Base32 format
Retrieve and display all page content properties in an AUI sortable table
Read and display the fixed version of Confluence pages by checking page or ancestor labels
Find images within page attachments. Handy for reusing files and updating them all at once.
Display space details such as type, status, creation date, and links to permissions and calendars
Generate an alphabetical list of labels from all spaces, linking each label to its corresponding content pages
Embed a typo-tolerant search bar directly into Confluence pages to find, highlight, and jump to specific content