How to hide part of the page title in the tree and page.

Glen Lipka September 10, 2014

I break down certain sections of my site into levels of complexity.  I call the folders Easy, Powerful and Complete.  However, since you can't name pages the exact same name, I actually have to write it as Easy (Administration), Powerful (Administration) and Complete (Administration).

I do this ONLY because I can't name pages the same thing.

I want to use jQuery (or other technique) to hide from the visitor the parts in parens.  I can get it to work onLoad, but not if the page is lazy-loaded in via Ajax.

Can anyone suggest a technique to do this?

Thanks!

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
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 11, 2014

The only way I can think of would be to hijack the page tree load method. The pattern would look like this.

 

AJS.toInit(function(){
	var pageTreeLoadMethodOld = AJS.pageTreeLoadMethod;
	AJS.pageTreeLoadMethod = function(){
		pageTreeLoadMethodOld();
 
		//Now you can do your stuff here
	}
});
Glen Lipka September 11, 2014

Is this every time the tree expands or just on the initial load?

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 11, 2014

Well, it looks like it doesn't load the whole tree initially, so it would be for every expand ... unless they are all at the root level.

Glen Lipka November 3, 2014

Unfortunately, this didn't work at all. I didn't get a JS error, but it didn't work at all. I just put an alert in the // part. Any ideas?

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.
November 3, 2014

I ran across this the other day while looking at the JS code and I think this is probably the better way to do it. I couldn't find any documentation on it, so I kinda just had to look through JS code for it. Maybe there is some documentation somewhere I just wan't finding it readily.

AJS.toInit(function(){
	AJS.bind('pagetree-children-loaded', function(){
		//Your stuff here.
	});
});
TAGS
AUG Leaders

Atlassian Community Events