Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paria Shiri 36 posts 109 karma points
    Oct 04, 2023 @ 12:04
    Paria Shiri
    0

    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...

  • Joshua Weber 20 posts 152 karma points
    Oct 04, 2023 @ 13:34
    Joshua Weber
    0

    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

  • Paria Shiri 36 posts 109 karma points
    Oct 09, 2023 @ 13:14
    Paria Shiri
    0

    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.

  • Marc Goodson 2155 posts 14406 karma points MVP 9x c-trib
    Oct 09, 2023 @ 20:38
    Marc Goodson
    0

    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

  • Paria Shiri 36 posts 109 karma points
    Oct 11, 2023 @ 11:30
    Paria Shiri
    1

    Thanks for your reply. I think I need to create my own property editor for this, which is really annoying.

  • Joshua Weber 20 posts 152 karma points
    Oct 11, 2023 @ 11:40
    Joshua Weber
    0

    Hope you have success with this! Good luck :)

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Oct 11, 2023 @ 12:06
    Huw Reddick
    0

    You may be able to do this with a ContentPublishingNotification event and set the sort order value when new content is published

  • Paria Shiri 36 posts 109 karma points
    Oct 13, 2023 @ 12:20
    Paria Shiri
    0

    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.

  • Paria Shiri 36 posts 109 karma points
    Oct 23, 2023 @ 07:31
    Paria Shiri
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft