I want to set the page tree on the left hand nav within a space to be automatically expanded so my users dont have to click to expand each page to see the child pages. Is this possible? Thanks
Hi Brett,
Are you currently using any customized Themes? If you are using Doc Theme, then maybe you could try this:
1
|
{pagetree:startDepth=3|searchBox= true } |
Here are some additional parameters also available to the pagetree macro: https://confluence.atlassian.com/display/DOC/Page+Tree+Macro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it appears to be a timing issue.in documentation theme of confluence 5.4, the execution of the function needs to be delayed a bit until the pagetree macro output is loaded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While I used this javascript in Confluence 4.3, it is not working in 5.4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any ideas how to accomplish that with the documentation theme?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maria,
maybe our add-on Scroll Versions does help you with that. Besides version- and variant-management, Scroll Versions comes with an enhanced pagetree that remembers which nodes were open also after page reload.
If you have further questions, or you want to do a online demo, please let us know by contacting sales@k15t.com.
Cheers,
Nils
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This works for Default Theme in 5.2.3 to automatically expand child pages:
<script type="text/javascript" >
AJS.toInit(function ($) {
AJS.$('a.more-children-link').click();
});
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Both of the above answers will only get you part of the way there. These will either expand the whole tree up to a certain level all of the time(which can get super heavy), or if you add in the paramter root=@self then you could see all of the child pages of the current page you are on if you did something like this.
{pagetree:root=@self|startDepth=1}
However, the page tree would change every time based on how far in you go into the tree. I don't think this is very intuative. Really there is no built in way to show the whole tree and expand only up to your current page and its children. You can work around it with some javascript, but as of the current version of the pagetree macro the below workaround has been broken. If you go back to the previous version of the pagetree macro it still works. I've been thinking about diving in and making the javascript workaround work with the current version but I just haven't had the time to research it. Here is s link to the workaround if you are willing to be on version 2.1.5.
The code to get it to work from the above link is below. You would need to stick this in the "At end of the HEAD" section of the Custom HTML page (Confluence Admin->Look and Feel->Custom HTML).
<script type="text/javascript" >
AJS.toInit(function ($) {
/////////////////////////////////////////////////////////////
// improve the pagetree functionality: "selected" class at //
// selected page and expand the children of selected page //
// first save the original pagetree function //
// "origHideEmptyChildrenContainer" //
/////////////////////////////////////////////////////////////
var origHideEmptyChildrenContainer = AJS.pagetree.hideEmptyChildrenContainers;
/////////////////////////////////////////////////////////////
// define our own one and overwrite the original pagetree //
// function "hideEmptyChildrenContainers" this function is //
// called by the pagetree after children finish loading //
/////////////////////////////////////////////////////////////
AJS.pagetree.hideEmptyChildrenContainers = function(pagetreeChildrenDiv) {
/////////////////////////////////////////////////////////////
//search for the child element with the style attribute //
/////////////////////////////////////////////////////////////
pagetreeChildrenDiv.find('span.plugin_pagetree_children_span').each(function(){
if(AJS.$(this).attr('style')) {
/////////////////////////////////////////////////////////////
// add a marker for the seleted page... now we can style //
// it with css //
/////////////////////////////////////////////////////////////
AJS.$(this).addClass("selected");
/////////////////////////////////////////////////////////////
// click on the plus icon to expand the children of the //
// current page //
/////////////////////////////////////////////////////////////
AJS.$(this).parent().parent().find('.plugin_pagetree_childtoggle_container a.plugin_pagetree_childtoggle').click();
}
});
/////////////////////////////////////////////////////////////
// call the saved original function... //
/////////////////////////////////////////////////////////////
origHideEmptyChildrenContainer(pagetreeChildrenDiv);
};
});
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's a similar request posted here: https://answers.atlassian.com/questions/21300/how-to-expand-page-tree-in-confluence-4-0-documentation-theme
Try out the suggested resolution and hope it works for you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.