Copied to clipboard

Flag this post as spam?

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


  • aleksandar 14 posts 74 karma points
    Sep 28, 2015 @ 12:19
    aleksandar
    0

    Set.value in multi node tree picker

    Hi does anyone know the data saving format for multi ndoe tree picker, i have problem when i want to programaticly set new value, not chosing from the umbraco cms.

  • Kevin Jump 1384 posts 8699 karma points MVP 2x c-trib
    Sep 29, 2015 @ 19:07
    Kevin Jump
    0

    Hi

    The MNTP values should just be a comma separated list of NodeIds, i.e

    1032,1042,1039

    If you have you're content item , its stored as a string, so you should beable to call

    item.SetValue("yourMNTPpropertyAlias", nodelist)
    

    remember to save the via the contentService.

  • David Armitage 187 posts 758 karma points
    May 22, 2018 @ 05:18
    David Armitage
    8

    Hi Guys,

    Its got a little more complicated recently. I miss the days when you could just pass in a list of Ids.

    Unfortunately you now have to pass in a list of UDIs. This is a combination of some document stuff and a formatted guid.

    A valid example would look something like this.

    string selectedItems = "umb://document/217f4677b69140958c8951eb3d3638f9,umb://document/d44a409e4f14416fb862356dd38cc7ac,umb://document/52595f172a934995ab0935087a012c6b"
    

    I used to generate the UDI manually by getting the node key(guid) and building up the string. Fortunately a recently found an easier way to generate this key.

    IPublishedContent node;
    string UDI = Udi.Create(Constants.UdiEntityType.Document, node.GetKey()).ToString();
    

    Hope this helps someone.

    Kind Regards

    David

  • Saif Obeidat 15 posts 97 karma points
    Apr 16, 2019 @ 13:04
    Saif Obeidat
    0

    Do you have any idea if it has been changed in Umbraco 8 as well?

Please Sign in or register to post replies

Write your reply to:

Draft