Topic: How do i expand or collapse folders

Hi I'm wondering how I can get my albums not to expand when I add a new album I want them to be collapsed when I log in to create a new album
Kosel Theme and Juicebox-Pro 1.5.1
Roffe

Re: How do i expand or collapse folders

Just to clarify, are you talking about the tree on the admin interface's 'Pages' tab (and not the navigation menu in the live site)?
As long as that's correct, then here's a suggestion.

Open up your site's 'showkase/admin/classes/pagesscreen.php' file in a plain text editor.

Change line 109 from:

$("#container").jstree({

... to:

$("#container").on("ready.jstree", function(event, data) {
    data.instance.close_all();
    data.instance.open_node("ref0");
}).jstree({

Now re-upload the 'pagesscreen.php' file to its original location on your web server (overwriting the existing file).

This will allow Showkase to build the 'Pages' tree and, once the tree is ready, the custom code will collapse all nodes and then open just the root node ('Public pages') so that you can see only your top-level pages.

I tried changing the state of each node (from open to closed) as Showkase creates the individual nodes but this has the unwanted effect that when you open an initially closed node, the tree registers this as a change. This results in an unnecessary reminder to 'Save' the change when you move to a different admin tab (without actually having made any functional changes to the tree, e.g. moving or renaming a node).
I think my suggestion above is perhaps the best option.

Notes:
(1) The line number above refers to the current version of Showakse (v1.7.6).
(2) Any changes to the Showkase source code should be done at your own risk. I do not foresee any problems with the code above but it would always be wise to make a complete backup of your site before modifying any source code, just in case anything unexpected happens and you need to reinstate your original files at a later date.

Re: How do i expand or collapse folders

Thanks for the help

Steven @ Showkase wrote:

Just to clarify, are you talking about the tree on the admin interface's 'Pages' tab (and not the navigation menu in the live site)?
As long as that's correct, then here's a suggestion.

Open up your site's 'showkase/admin/classes/pagesscreen.php' file in a plain text editor.

Change line 109 from:

$("#container").jstree({

... to:

$("#container").on("ready.jstree", function(event, data) {
    data.instance.close_all();
    data.instance.open_node("ref0");
}).jstree({

Now re-upload the 'pagesscreen.php' file to its original location on your web server (overwriting the existing file).

This will allow Showkase to build the 'Pages' tree and, once the tree is ready, the custom code will collapse all nodes and then open just the root node ('Public pages') so that you can see only your top-level pages.

I tried changing the state of each node (from open to closed) as Showkase creates the individual nodes but this has the unwanted effect that when you open an initially closed node, the tree registers this as a change. This results in an unnecessary reminder to 'Save' the change when you move to a different admin tab (without actually having made any functional changes to the tree, e.g. moving or renaming a node).
I think my suggestion above is perhaps the best option.

Notes:
(1) The line number above refers to the current version of Showakse (v1.7.6).
(2) Any changes to the Showkase source code should be done at your own risk. I do not foresee any problems with the code above but it would always be wise to make a complete backup of your site before modifying any source code, just in case anything unexpected happens and you need to reinstate your original files at a later date.

Re: How do i expand or collapse folders

You're welcome!