Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Compact sidebar per default

Björn Eitmann September 25, 2013

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

3 answers

0 votes
Brian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2013

Hi Bjorn, one other thing to be aware of is that the sidebar width preference is stored in a cookie.

0 votes
Björn Eitmann September 26, 2013

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!

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2013

What do you mean by click on "pages"?

Björn Eitmann September 29, 2013

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.

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2013

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?

Björn Eitmann September 30, 2013

Hi Davin. No, we have a special designed Space for our company homepage, so i have to use the macro on the spaces wich should show the compact sidebar on their home's.

Björn Eitmann October 1, 2013

Hi Davin

I am sorry, but that is not what we need. We just want to have the default compact (small) sidebar on a few pages without clicking on "pages" first. That would be great. The Navigation out of the macro you build hides our company logo.

Thanks a lot for your help!

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2013

Ok. I removed the second answer. The first user macro should get you what you want. It should compact the sidebar by default on any page that the macro is included on.

0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

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>

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

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>

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2013

Ok, I think this should meet your needs to have the fly-out navigation appear by default.

Macro Name:
collapsenav

Macro Ttle:
Collapse Nav

Description:
Collapse the sidebar and show fly-out 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 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>

Shawn Smith November 18, 2013

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.

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2013

Yeah, it programatically clicks the collapse button which saves the state. If you want to only collapse it on certain pages, you would have to set the css styles manually so that it is not carried to other pages.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events