This project is read-only.

Media Picker is not working for my content type

Topics: Writing modules
Jun 1, 2012 at 5:57 PM

Hi, I have created a content type which has BodyPart. Content type is doing almost fine and there is no problem in CRUD operations. Also for bodypart, Html editor is there while editing. Problem is, Media picker is not working in the html editor, I have enabled media picker and it works in blog post editing. Am I missing something? Is there any else I have to do other than adding bodypart in my content type


Jun 1, 2012 at 6:19 PM

public class CityPart : ContentPart<CityPartRecord>
        public String Title
            get { return this.As<ITitleAspect>().Title; }

        public String Text
            get { return this.As<BodyPart>().Text; }
            set { this.As<BodyPart>().Text = value; }

        public String ExternalLink
            get { return Record.ExternalLink; }
            set { Record.ExternalLink = value; }

        public int CountyId
            get { return Record.CountyId; }
            set { Record.CountyId = value; }

this is how I have created the content type(in handler)
this.Filters.Add(new ActivatingFilter<CityPart>(Constants.ContentTypes.City));
this.Filters.Add(new ActivatingFilter<BodyPart>(Constants.ContentTypes.City));
this.Filters.Add(new ActivatingFilter<TitlePart>(Constants.ContentTypes.City)

Jun 1, 2012 at 7:56 PM

Why did you do that from the handler rather than from a migration, once and for all?

Jun 2, 2012 at 6:42 AM

Doing this in migration will make the part and content type visible and editable through admin.This is what i don't want. however this is not an issue, I have another module in which I have defined part and content type in the data migration and media picker is not working for that module too.

Jun 4, 2012 at 7:44 AM
Edited Jun 4, 2012 at 8:30 AM

got it. MediaPicker scripts looks for the admin word in the url whereas I was using a controller which has name ProductAdmin and custom admin menu which results in admin url without admin word. You have to rename ur controller to admin or define routes.