OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.43k stars 2.4k forks source link

Add New Item to ListPart at the Top by Default #16052

Open jaliao opened 5 months ago

jaliao commented 5 months ago

Dear Orchard Core Team,

I hope this message finds you well.

I would like to request a feature enhancement for the ListPart in Orchard Core. Currently, when adding a new item to the ListPart, it is appended to the bottom of the list. However, I would find it extremely useful if there were an option to have new items automatically positioned at the top of the list by default.

This feature would significantly improve the workflow for users who often need to prioritize the most recent entries.

Thank you for considering this request. I appreciate all the hard work the team puts into making Orchard Core a fantastic platform.

Best regards, Justin Liao

Piedone commented 5 months ago

List Part is mostly about structuring a content relationship, but you don't necessarily need to list content items how it does by default (but e.g. you can use Queries).

What's your use case, specifically? Where do items appear at the bottom of the list?

MikeAlhayek commented 5 months ago

This could be a good option to add to the setting of the BagPart. By default we add item at the end, but with the new options we can change the behavior.

Piedone commented 5 months ago

For Bag Part I'd understand, but this issue is about List Part so I'm a bit unclear about the use case.

MikeAlhayek commented 5 months ago

oh I read it "BagPart" lol. I am not sure what is that ask then.

jaliao commented 5 months ago

There is a Content Type "Product" in the backend that uses ListPart with the Order sorting feature enabled. There are several records inside, and when a new record "Watch 123" is added, it is placed at the end by default. We hope to have the new data sorted at the top by default. image

jaliao commented 5 months ago

Although there are queries available, we hope to use the Order field of the List Part as the basis for sorting. Currently, the Order number of newly added items is the largest number.

MikeAlhayek commented 5 months ago

I can't remember out of the top of my head, but there is a sort filter on contents that you can sort by updated as descending/ascending. I think the same filter exists when list part is used.

sebastienros commented 5 months ago

Internally it's incrementing a counter (Order). This doesn't have to change. But ordering options in the display (and the services) would be useful.