Oldest item first in Categories listings?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
ircraigie
Posts: 4
Joined: Sat Jan 20, 2007 2:44 am

Oldest item first in Categories listings?

Post by ircraigie »

How do I change the displayed order of items in a selected category to the oldest first?

Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Oldest item first in Categories listings?

Post by garvinhicking »

Hi!

The fetch order and amount of entries is done in the Serendipity file include/genpage.inc.php via the call to serendipity_fetchEntries(). By default there is no order, which will then fallback to the set value within that function of the file include/functions_entries.inc.php.

So those two places would have needed to be changed, but I think this would be too complicated.

Thus I modified the plugin 'Extended properties/templates of categories' so that you can customize the sort order per category in version 0.10 of the plugin. The update will be available tomorrow on Spartacus!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ircraigie
Posts: 4
Joined: Sat Jan 20, 2007 2:44 am

Post by ircraigie »

Almost - was hoping to leave the default newest post first when All Categories was being viewed.

Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The default category posting order can be configured inside the plugins configuration, and should default to "timestamp DESC"!

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ircraigie
Posts: 4
Joined: Sat Jan 20, 2007 2:44 am

Post by ircraigie »

garvinhicking wrote:Hi!

The default category posting order can be configured inside the plugins configuration, and should default to "timestamp DESC"!

HTH,
Garvin
Yup, got the updated plugin and when I changed the setting to "timestamp ASC" it did change the order of the items to oldest first. The issue is that it changes the Frontpage/All Categories order as well. Is there some way to form an external link URL like index.php?/categories/category1&order=ASC to get the result I am looking for (display categories oldest first and the frontpage/all categories as newest first).

Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The category order for the Frontpage/All Categories is equal to the order configured in the plugin configuration. Only when you are in a single category the different ordering is applied!

So if you leave "timestamp DESC" in the plugin configuration and only enter "timestamp ASC" in the category property screen for the single category, you should get what you need?

Or you can have it the other way round - enter "timestamp ASC" in the plugin configuration screen, and then for each category enter "timestamp DESC"!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ircraigie
Posts: 4
Joined: Sat Jan 20, 2007 2:44 am

Post by ircraigie »

garvinhicking wrote:Hi!

The category order for the Frontpage/All Categories is equal to the order configured in the plugin configuration. Only when you are in a single category the different ordering is applied!

So if you leave "timestamp DESC" in the plugin configuration and only enter "timestamp ASC" in the category property screen for the single category, you should get what you need?

Or you can have it the other way round - enter "timestamp ASC" in the plugin configuration screen, and then for each category enter "timestamp DESC"!

Regards,
Garvin
OK - got it, missed the property box on the individual categories edit page.

Thanks
Post Reply