Can I link to Confluence page and automatically collapse sidebar?

I want to iframe a Confluence page into a different website, but ideally it would be done without the sidebar open by default.

Is there a way I can manipulate the URL that I embed so the sidebar doesn't appear unless activated?

Basically the website I will be embed Confluence into has limited real estate and the sidebar takes up a lot of space.

2 answers

1 accepted

2 votes
Accepted answer
Davin Studer Community Champion Apr 02, 2015

You could create a user macro that will override the styles of the page if a certain parameter is in the query string of the url. The below user macro example would only display the page content if the url had the value ?frameable=true at the end. Then just put the user macro on pages that you want to put in an iframe on another page. Or you could put the user macro in the page theme decorator if you want every page to be able to do this. In your iframe reference the wiki page with ?frameable=true at the end of the url and Voila!

Macro Name:


Macro Body Processing:
No macro body


## Developed by: Davin Studer
## Date created: 04/02/2015
## @noparams
#if($req.getParameter('frameable') == "true")
#set ($p = '#')
${p}header, ${p}footer, .ia-splitter .ia-splitter-left, ${p}labels-section, ${p}comments-section, ${p}sidebar-container, ${p}main-header, ${p}content .page-metadata {display: none !important;}
${p}main {margin-left: 0 !important; border: 0 !important; padding: 0 !important;}
body {background: ${p}FFFFFF !important;}

This is incredibly helpful, thank you!

Smart and simple! Thank you fro sharing.

The only way I currently know how to do it is with javascript but that won't really help in your situation. I think you are looking for some kind of parameter that you can add in the URL to close the sidebar but I don't believe there is a parameter that does that in confluence. The other option is to go nuclear and just get rid of the sidebar completely from confluence.


Some info here may help you:


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,551 views 25 14
Join discussion

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