When a news is created, it is displayed last in the news list at the OPAC. You can change that behaviors by using the field 'Number' to order them manually but then, you have to manually edit all news to add a new one first.
It looks like the sort by "Number" is hard-coded, so we'd have to update the code to offer alternatives. I think it would be logical to add the option of sorting by date ascending or date descending. I'm not sure how you'd handle sorting first by number and then by date.
Created attachment 177588 [details] [review] Bug 39027: Order news on opac-main.pl by publication date instead of ID On the OPAC, news should rather be ordered by the publication date than by the creation date (~ id): a user want to see last published news first and not last created news, regardless of their publication date TEST PLAN: 1 - Create 3 news, have the 3 news published in an order different from their id (for example news 1 => 2020, news 2 => 2025, news 3 => 2023) 2 - Go on http://youropac/cgi-bin/koha/opac-main.pl -> news are ordered by ID APPLY PATCH 3 - Repeat 2 -> news are ordered by Date
@Owen, oh sry I did not see your comment before publishing How would the sort be chosen ? By a syspref ?
Can we expand this issue to cover the staff interface as well? News can be displayed in both places and it suffers from that problem as well. Honestly, sorting by publish date ascending doesn't make any sense to me, so one could even think about changing the default to descending :) If not, then a syspref would be much appreciated. Cheers
Normally, for a news site, you would want to see the latest news item at the top (well, I would anyway). But I also understand that this may not suit everyone, and how different libraries use the news feature. How about a link/button to sort by latest or earliest? Not sure how to do this and make it look nice. But then this would muck up the numbered option that you can set, which is also used for HTML customisations. If sorting by "Appear in position" is not used, then it shouldn't be shown on the form. I guess "we" will have to choose! So maybe the logic would be: 1. If there is an "Appear in position" value, show in the order specified. 2. If some "Appear in position" values, show in the specified order then by date published with the latest first. 3. If there is no "Appear in position" values, sort with the latest item first (published date). 4. Have a link to sort by latest/oldest. 5. Something else? 6. Give up and leave Current behavour for news: 1. If no "Appear in position", news is displayed by the creation date, with the earliest date first (?). 2. Use "Appear in position" to sort in your preferred order. 3. If "Appear in position" is only used on some items, sorts in descending order (2, 1, ...) with ones without after this in the date created order. Behavour after the patch for both OPAC and staff interface: 1. Displayed by published date, with the oldest at the top and the latest at the bottom. Changing status to in discussion.
I think I'd prefer a syspref to define the default order (publish data asc/desc). If there's an override via "Appear in position" then respect that. What I don't like is a link/button to change the order interactively, *if* users have to click it every time - i.e. due to a lacking desired default.