Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category Browser - change sort order

Quote Reply
Category Browser - change sort order
Hello!

Can anyone tell me how to change the sort order of the category browser?

I'm playing with it at the moment, but even though my sql statement sorts it in a specific way, and it writes the $instructions to the code template in that order, the final display always appears in alphabetical order.

Can anyone help?

Thanks.
Regan.
Quote Reply
Re: [ryel01] Category Browser - change sort order In reply to
The category browser is a black box of code to me. Javascript.

But, if what you are trying to do is to get the pages it displays to show the links in a different order, the javascript uses routines in the various admin modules, and it's probably there you need to look.

Once you are on the page, though, you should be able to pass commands in and out of the perl routines, without using the category browser code, so your first page may be in default format, but you can use the template itself to allow you to format the output in different ways.

It's late, and I might be misreading what you are trying to do.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Category Browser - change sort order In reply to
Hi Pugdog

Not quite what I'm after - I want the categories in the actual category browser (the bit with all the folders) to display in the order that the code is passed into the browser_code template.

I have tracked the sorting down to this subroutine in browser.html...

" function LoadedNode_addChild "

now I've just got to figure out how it works (I'm no wizz at javascript either). Changing code there changes the order though so I'm getting closer.

Hopefully someone from GT will pop in and help out with this one - after searching the forum I see the same question has been asked before but not solved yet.

Cheers!

Regan.
Quote Reply
Re: [ryel01] Category Browser - change sort order In reply to
hmmmm... changing the following code in that subroutine:

Code:

for (var i=this.child.length; i > 0; i--)
{
if (this.child[i-1].getName().toUpperCase() > aChild.getName().toUpperCase())
{
this.child = aChild;
return;
}
else
{
this.child = this.child[i-1];
}
}

this.child[0] = aChild;


to this...

Code:

this.child.push(aChild);

sticks the categories in the correct order (as passed in), but when I click to expand any of the unloaded nodes it drops the selected node to the bottom of the list instead of holding its position.

aghghghhhhhh.... :)

regan