Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Sort Problem

Quote Reply
Sort Problem
Hi All,

I am trying to set my sort order in Links.pm to sort in the folloing manner:

All those links that have been flagged as "Priority" first, and then alphabetically by title after that.

The following does not seem to work (links are just sorted alphabetically):

$LINKS{build_sort_order_category} = "Priority DESC,Title";

Any ideas what the problem might be?

Quote Reply
Re: Sort Problem In reply to
That seems to be a criteria on categories and not on links.
I don't yet know the code to point you where you have to go and what to do. Try to see what you can do in Links.pm

Quote Reply
Re: Sort Problem In reply to
I see what you are saying, but all I see is:

$LINKS{build_sort_order_category} = "Priority DESC,Title";
$LINKS{build_sort_order_new} = "Priority DESC,Title";
$LINKS{build_sort_order_cool} = "Priority DESC,Title";
$LINKS{build_sort_order_search} = "Priority DESC,Title";

There doesn't seem to be any sort order for Links specifically. I set them all to Priority DESC,Title to see if it would fix the problem, and no luck.

Quote Reply
Re: Sort Problem In reply to
Stupid question: Did you put the right values in the Priority filed (low value => low priority)?

Quote Reply
Re: Sort Problem In reply to
I'm not exactly sure what you mean, but the Priority links have been flagged properly. Anything greater than 0 is tagged as priority, and the "Priority" image pops up beside them. The problem seems to be with the sort... I don't know what to change or how, since my previous post displayed the sort as I have it in my Links.pm file, which one would think would work.

Quote Reply
Re: Sort Problem In reply to
I am afraid only Dan Kaplan can help you. Try to send him an email

Quote Reply
Re: Sort Problem In reply to
Ok --

The sort order in the Links.pm file applies to "links" displayed in each of those areas.

You cannot change the order of links returned by 'search.cgi' -- thats score - order by default.

The other pages you can change the order, but if you have a lot of alt-links defined, they mess up the sort. So, it won't work with a lot of alt-links.

To sort by priority, with the most priority on top:

$LINKS{build_sort_order_category} = "Priority DESC,Title";

Should do it. _IF_ you have a field called "Priority" in your Links table.

But, if you have alt-links defined, it won't work as expected, because of the way the alt-links are inserted into the hard-links.



Quote Reply
Re: Sort Problem In reply to
Puddog,

Thanks. As I have it, the sort is not working ideally. So I suppose my problem is with "alt-links." What exactly do you mean by this?

Adam

Quote Reply
Re: Sort Problem In reply to
alt-links refers to links placed in more than one category, often referred to as alternate links or alternate categories. If you search the forum for some of those terms, you will get an idea of the sort problems with alt-links. I would be very surprised if this is not corrected or at least seriously addressed in the impending Links SQL release.

Dan