Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to change the sort order of "db_gen_category_list"?

Quote Reply
How to change the sort order of "db_gen_category_list"?

Hello,

I translated the script to Hebrew.

build_category_sort is setup to ID which works great.

My problem is with db_gen_category_list. The sort order is random and confusing (guess because of the Hebrew characters).

How could I force the category list in the add form (db_gen_category_list) to sort by ID?

Any information would be appreciated.

Thank you!

Last edited by:

Kool: Aug 26, 2007, 8:08 AM
Quote Reply
Re: [Kool] How to change the sort order of "db_gen_category_list"? In reply to
Hello,

In your admin panel: Setup->Build Options->build_category_sort, by default this is set to Name.

Hope this helps :)

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] How to change the sort order of "db_gen_category_list"? In reply to
Hi,

In my admin panel: Setup->Build Options->build_category_sort, is set to ID. This setup works well for Hebrew.

It looks like "db_gen_category_list" in the add form is still sorting by Name. The setup in build_category_sort = ID, didn't change the sort.

I need to change the sort of "db_gen_category_list" from Name to ID.

Any ideas?

Thanks alot!
Quote Reply
Re: [Kool] How to change the sort order of "db_gen_category_list"? In reply to
Hm, this is strange.

I have 2 sites running GLinks in cyrillic and sorting by Name is fine on all places (category, add/modify forms) :\
Is mysql encoding set properly? Sometimes this cause a sorting problem in non English languages.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] How to change the sort order of "db_gen_category_list"? In reply to
It works well for Latin alphabet, but not for Hebrew!

In Hebrew “Name” setup yields random sorting, so I’m using “ID”; which works only in the home page. The add form is still sorting by “Name”


<%loop category_loop%> in the forms is not following the setup in Admin(for non Latin alphabet)! Is that a bug?


I need a fix…

Dave Smile

Last edited by:

Kool: Aug 26, 2007, 10:29 AM
Quote Reply
Re: [Kool] How to change the sort order of "db_gen_category_list"? In reply to
What db_gen_category_list setting are you using?

Adrian
Quote Reply
Re: [brewt] How to change the sort order of "db_gen_category_list"? In reply to
Hi Adrian,

My setup for db_gen_category_list is “basic”. I have the same sorting problem even if I use AJAX in setup.


Thank you!
Quote Reply
Re: [Kool] How to change the sort order of "db_gen_category_list"? In reply to
Sorting by anything other Full_Name (what it does now), is difficult because of the tree structure of categories. If you still wish to go ahead with sorting by something else, you'll have to change the code. Take a look at Links/Tools.pm, sub category_list (where it does ORDER BY Full_Name).

Adrian
Quote Reply
Re: [brewt] How to change the sort order of "db_gen_category_list"? In reply to
Hi,

my @ids = $IN->param('CatLinks.CategoryID');
@ids = $IN->param('ID') unless @ids;
return unless @ids;
my $cat = $DB->table('Category');
$cat->select_options("ORDER BY Full_Name");
return $cat->select({ ID => \@ids })->fetchall_hashref

To sort by ID what do I have to replace ("ORDER BY Full_Name") with? ("ORDER BY CategoryID") ?

Thank you for the help,
Dave
Quote Reply
Re: [Kool] How to change the sort order of "db_gen_category_list"? In reply to
No, it should be ORDER BY ID.

Adrian
Quote Reply
Re: [brewt] How to change the sort order of "db_gen_category_list"? In reply to
Thank you guys! its works!

Dave