Copied to clipboard

Flag this post as spam?

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


  • Koen van Ras 56 posts 361 karma points c-trib
    Apr 22, 2020 @ 17:50
    Koen van Ras
    0

    Convert IMedia item to IPublishedContent

    Hi,

    Is it possible to convert a IMedia item to IPublishedContent? I've got a list with IMedia items from the Umbraco Media section and want to convert these Images to IPublishedContent.

  • Alex Skrypnyk 6148 posts 24097 karma points MVP 8x admin c-trib
    Apr 22, 2020 @ 19:31
    Alex Skrypnyk
    100

    Hi Keon,

    var mediaPublishedContent = Umbraco.Media(mediaItem.Id);
    

    Just get it by Id with UmbracoHelper.Media

    Thanks,

    Alex

  • Koen van Ras 56 posts 361 karma points c-trib
    Apr 23, 2020 @ 07:01
    Koen van Ras
    0

    Hi Alex,

    Thanks, that did the trick!

Please Sign in or register to post replies

Write your reply to:

Draft