Hi*
We want our HOME pages to view the compact sidebar per default. At the moment we first have to click on pages to view this. This is one click to much ;-)
Some ideas to do that?
Best,
Björn
You could put this into an html macro on your home page. It will check if the sidebar is collapsed. If not it will programatically click the collapse handle for you.
<script type="text/javascript"> AJS.toInit(function () { if(AJS.$('.ia-fixed-sidebar.collapsed').length == 0) { AJS.$('.ia-fixed-sidebar .space-tools-section .expand-collapse-trigger').click(); } }); </script>
You could even take it a step futher and create a user macro that you could put on any page that you want to have the nav collapsed by default.
Macro Name:collapsenav
Macro Ttle:Collapse Nav
Description:Collapse the nav on page access.
Macro Body Processing:No macro body
Template:## Macro title: Collapse Nav## Macro has a body: N## Developed by: Davin Studer## Date created: 09/26/2013## Collapse the nav on page access.
## @noparams
<ac:macro ac:name="html"> <ac:plain-text-body><![CDATA[<script type="text/javascript">AJS.toInit(function () { if(AJS.$('.ia-fixed-sidebar.collapsed').length == 0) { AJS.$('.ia-fixed-sidebar .space-tools-section .expand-collapse-trigger').click(); }});</script>]]></ac:plain-text-body></ac:macro>
Thank you very much! One problem left ...
We have to choose the default theme, because we are using the design plugin CUTE. Is it possible to script that macro to click first on "pages" so that we can use the default theme and have the compact sidebar?!
That would be great!
What do you mean by click on "pages"?
Hi Bjorn, one other thing to be aware of is that the sidebar width preference is stored in a cookie.
When using the default theme the homepages of the spaces are without sidebar. So if we want to see them, we have to click on the link pages above the space title to have a sidebar. would be fine, if we could use the default theme WITH a compact sidebar per default on the space home's.
Ok, I think I get what you are saying. Are you wanting to have the fly-out navigation visible by default on the home page?
Ok, I think this should meet your needs to have the fly-out navigation appear by default.
Description:Collapse the sidebar and show fly-out nav on page access.
Template:
## Macro title: Collapse Nav ## Macro has a body: N ## Developed by: Davin Studer ## Date created: 09/26/2013 ## Collapse the sidebar and show fly-out nav on page access. ## @noparams <ac:macro ac:name="html"> <ac:plain-text-body><![CDATA[<script type="text/javascript"> AJS.toInit(function () { if(AJS.$('.ia-fixed-sidebar.collapsed').length == 0) { AJS.$('.ia-fixed-sidebar .space-tools-section .expand-collapse-trigger').click(); } AJS.$('.ia-secondary-header .parent.ia-secondary-header-title.wiki .parent-item .parent-item-link[title=Pages]').click(); }); </script>]]></ac:plain-text-body> </ac:macro>
Davin,
When setting this up in Confluence 5.3.1, it works, but once collapsed it seems like all Global Theme spaces and other pages in the same space are now collapsed as well.
It looks like you're new here. Sign in or register to get started.