Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to sort New and Cool links by category?

Quote Reply
How to sort New and Cool links by category?
Is there a way to sort new and cool links by category name and then link name? The way I have it right now makes no sense... since the links are displayed with their category, sorting by link first makes no sense.

Please advise.

Quote Reply
Re: How to sort New and Cool links by category? In reply to
I just answered a similar question you posted in another Thread.

Regards,

Eliot Lee
Quote Reply
Re: How to sort New and Cool links by category? In reply to
ELiot,

Thanks again, but I don't think your previous answer helped me in terms of this dilemma. My problem is that the sorting of new and cool links does not seem to be logical. See, for instance, http://www.hothockey.com/links/New/ and http://www.hothockey.com/links/Cool/.

What I would like to do is sort Cool links in descending order by Hits (like Postcards.com) and New links in ascending order by name. I have the following sort orders set in the ConfigData.pm file:

'build_category_sort' => 'Cat_Sort,Name', [Cat_Sort is a field I created to force the sorting of some categories before others]

'build_sort_order_new' => 'Title',

'build_sort_order_search' => 'score',

'build_sort_order_category' => 'Title',

'build_sort_order_search_cat' => 'score',

'build_sort_order_cool' => 'Hits DESC',

I must be missing something, but I don't see what. In my Cool and New links, it looks as though it is sorting by Category first and then the links... but I still can't figure out the logic.

Anyone?

Quote Reply
Re: How to sort New and Cool links by category? In reply to
Hi,

My POSTCARDS.COM site is still running 1.1x since the number of custom mods (including that one) is quite high).

In Links 2.0 you should be able to get a similar effect by turning the 'gb_*' functions off, and then specifying the sort order in the sort_ fields, as "HITS DESC" and "Title ASC"



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: How to sort New and Cool links by category? In reply to
Thanks, I'll try that. What are the gb functions anyhow?

Quote Reply
Re: How to sort New and Cool links by category? In reply to
"Group by" I was one of the ones who pushed to make this an option. It used to be the default behaviour.


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: How to sort New and Cool links by category? In reply to
Thanks for that :) I just made the changes and it works great. One thing now: is there a way to keep the sorting as it is right now (links listed in order) but somehow also display the category that they belong to?

I'm thinking that I could display the category under each link, but that would probably necessitate having that added to link.html and thus appearing on all links, not just NEW, COOL, and SEARCH RESULTS.

Is there a way, maybe, to alter the display in <%link_results%> which appears to be called by all of NEW, COOL, and SEARCH RESULTS?