I've never got any answer in this forum, I hope I can get one this time :(
I have thousands of items which come up in the selection list of a Multinode tree picker. The problem is their sorting order, the newest is on the last page (here 34100th page). I like to have some control over this data, like having the 100 newest. I searched a lot but I couldn't find any solution.
There should be an event when you click on the MultiNode tree picker somewhere...
as far as I am aware this is not possible. Have you looked at Umbraco Extensions and checked if there is something there that might be abled to help you?
I tried to find a related event or service but no luck. It seems it directly loads them from the database. Maybe there is no way except to make a new property editor but it seems hacky I don't want to do that.
I think it would still be a great improvement to the core!
In the end I created a custom property editor, starting from the core picker and reverted the sort order, so that the latest added things were always on the first page to be picked...
I don't have a link to the code anymore, and things have probably moved on with the implementation of the picker since then, but there is some info here on what I did, in a PR to make the sort order switch work!
I had an implementation to update the sort order, but it doesn't seem efficient as for each new item, the sort order of all existing ones must be updated. Maybe the hacky way is the only solution.
Tree Picker Data - need newest first
I've never got any answer in this forum, I hope I can get one this time :(
I have thousands of items which come up in the selection list of a Multinode tree picker. The problem is their sorting order, the newest is on the last page (here 34100th page). I like to have some control over this data, like having the 100 newest. I searched a lot but I couldn't find any solution.
There should be an event when you click on the MultiNode tree picker somewhere...
Hello Paria,
as far as I am aware this is not possible. Have you looked at Umbraco Extensions and checked if there is something there that might be abled to help you?
Best regards,
Joshua
I tried to find a related event or service but no luck. It seems it directly loads them from the database. Maybe there is no way except to make a new property editor but it seems hacky I don't want to do that.
Hi Paria
I had this need on a site a few years ago, I created this issue in the tracker...
https://github.com/umbraco/Umbraco-CMS/issues/5260
I think it would still be a great improvement to the core!
In the end I created a custom property editor, starting from the core picker and reverted the sort order, so that the latest added things were always on the first page to be picked...
I don't have a link to the code anymore, and things have probably moved on with the implementation of the picker since then, but there is some info here on what I did, in a PR to make the sort order switch work!
https://github.com/umbraco/Umbraco-CMS/pull/3692
A similar hack might work for you?
Regards
Marc
Thanks for your reply. I think I need to create my own property editor for this, which is really annoying.
Hope you have success with this! Good luck :)
You may be able to do this with a ContentPublishingNotification event and set the sort order value when new content is published
It seems like a solution for new documents, but for existing ones, I think I can run a routine to sort them. I'll try that, thanks.
I had an implementation to update the sort order, but it doesn't seem efficient as for each new item, the sort order of all existing ones must be updated. Maybe the hacky way is the only solution.
is working on a reply...