Add Media to the MediaLibraryPickerField in the code

Topics: General, Writing modules
Aug 11, 2013 at 8:09 PM
Hi again! ))
I trying to build my own Import module....
In my new Custom Content Type - "Article" i have MediaLibraryPickerField - "MainImage"
How, in my controller, i can add Image (MediaPart or else...) to that Field

Thanks in advance!!!
Aug 12, 2013 at 12:54 AM
If you get a reference to that field and cast it to MediaLibraryPickerField, you will be able to overwrite the Ids array with your own array of media content item ids.