Copied to clipboard

Flag this post as spam?

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


  • Dennis Morgan 3 posts 20 karma points
    Aug 04, 2009 @ 21:00
    Dennis Morgan
    0

    how to assign media to document in api?

    I have created a media item in code and see it show up under the umbraco media section. At the same time I am trying to create a document and assign one of it's properties to the newly created media. For example:

    The newly created media object is "m". The documenttype property is "guestbookImage" which is a media type. When I try to create a document every other property is populated except for the media type. I am not sure what to assign to this property? I have tried:

    doc.getProperty("guestbookImage").Value = m

    doc.getProperty("guestbookImage").Value = m.Id

    Neither one seems to populate it? Is there a property of the media class I should be using? Any help or examples would be appreciated. Thanks.

     

     

  • Dennis Morgan 3 posts 20 karma points
    Aug 04, 2009 @ 22:23
    Dennis Morgan
    0

    Using m.Id (media Id parameter) works.

    I was working with python and foolishly had the code indented where it shouldn't have been.. Used to C# hehe. Ah well. Sorry if I wasted anyone's time.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies