Page 1 of 1

Oldest item first in Categories listings?

Posted: Sat Jan 20, 2007 2:47 am
by ircraigie
How do I change the displayed order of items in a selected category to the oldest first?

Thanks

Re: Oldest item first in Categories listings?

Posted: Mon Jan 22, 2007 2:00 pm
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

Posted: Tue Jan 23, 2007 5:09 pm
by ircraigie
Almost - was hoping to leave the default newest post first when All Categories was being viewed.

Thanks

Posted: Wed Jan 24, 2007 9:37 am
by garvinhicking
Hi!

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

HTH,
Garvin

Posted: Wed Jan 24, 2007 6:07 pm
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

Posted: Thu Jan 25, 2007 11:40 am
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

Posted: Thu Jan 25, 2007 5:45 pm
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