Copied to clipboard

Flag this post as spam?

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


  • Paul de Quant 403 posts 1520 karma points
    Apr 25, 2018 @ 16:27
    Paul de Quant
    1

    TypedContent with List of UDI's

    Hello,

    Can anyone tell me if TypedContent works with a list of UDis?

    Thanks

    Paul

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 25, 2018 @ 16:53
    Kevin Jump
    0

    Hi

    No it doesn't at the moment, it only excepts lists of either Ids or Guids (which are the end of UDIs).

    you either have to do something with the udi values.

    I am not sure but you might be able to extract the guids of the UDIs:

    var guids = udis.Select(x => ((GuidUdi)x).Guid);
    Umbraco.TypedContent(guids);
    

    but that bypasses some of the UDI goodness. so it might be better to loop them ?

    var items = new List<IPublishedContent>();
    foreach(var udi in udis)
    {
        var item = Umbraco.TypedContent(udi);
        if (item != null)
        {
            items.Add(item);
        }
    
    }
    
  • Paul de Quant 403 posts 1520 karma points
    Apr 26, 2018 @ 09:04
    Paul de Quant
    0

    Thanks Kevin, and what would be to angular version of this, if any. I need to update my grid controls.

    I thought I could use entityResource.getById(udi, "Document")

    but it doesn't seem to work.

    Thanks

    Paul

Please Sign in or register to post replies

Write your reply to:

Draft