This project is read-only.

how to save the data in owner table?

Topics: Customizing Orchard
Aug 9, 2013 at 4:34 AM
I want to save data in my owner table, for example,I create a PictureNews module,
the PicNewsPartRecord has three properties
  public class PicNewsPartRecord : ContentPartRecord {
       public virtual string Title {get;set;}

        public virtual string Body { get; set; }

        public virtual string PicUrl { get; set; }
I want all the info save in PicNewsPartRecord table.
the question is:
how to use the Shape of Orchard.Core's BodyPart? and the upload Img field?
Aug 9, 2013 at 6:10 AM
Based on the name you used for your class, it looks like you're creating a custom part.
Implement a driver for this custom part to provide editor shapes and handle the post back of the content editor form.
Aug 9, 2013 at 7:39 AM
Edited Aug 9, 2013 at 7:43 AM
yes,thank you. Maybe because my poor English, I didn't describe my clear meaning. I meaning how to show TinyMce editor in my editor shapes and how to show a Media Picker page.
Aug 9, 2013 at 7:45 AM
Oh I see. Look at the TinyMce module (specifically the Body-Html.Editor view) to see how to initialize TinyMce.
To render a file upload input element, simply render <input type="file"/>.
In your driver's updateEditor method, access the uploaded file via the HttpContext.Request.Files collection. (HttpContext is accessible if you inject RequestContext, or IWorkContextAccessor).