Try our conversational search powered by Generative AI!

Custom Content Provider Media


I'm planning to develop a custom content provider that will expose media located at an external source. I think the media will be only documents and you should be able to navigate the complete tree structure from the external source and see eventual documents located in each folder.

Is the best approach to inherit MediaRepositoryDescriptor and the Documents to inherit MediaData? And also to use base("epi-cms/widget/HierarchicalList") for the component?

I would like for the documents to be able to be dragged-and-dropped from the widget as well as being selected from the content selector-dialog.

Another issue I'm not sure of is how to handle if the media is removed from the external source, will the broken link be caught by the link validator job or do you need to implement something to take care of this? 

Edited, Oct 26, 2017 20:58

I have done a test where the type Document inherits from MediaData. When I open up the Content Selector I can see the documents but it's not possible to select any.

If I drag-and-drop the document into a list with link items the href is relative and it thinks it's located in Media. So it will return a 404-page.

What am I missing?

Thanks in advance!

Oct 30, 2017 16:13

Did you figure this out?
I am looking to do something similar just for product images.

I have been looking at writing a content provider: 

Nov 13, 2017 15:36

You should check out the local media provider:

Nov 14, 2017 7:50

The document in episerver edit mode says that it's not published yet, even though I'm doing this in code:

versionable.Status = VersionStatus.Published;

versionable.IsPendingPublish = false;

versionable.StartPublish = createdDate;

I'm suspecting that this is the reason why it's not selectable?

Nov 14, 2017 15:01

The reason that the items weren't selectable in dialogs where that parentlink was wrong.

I'm using MediaRepositoryDescriptor

Component base("epi-cms/component/Media") 

My custom class inherits MediaData.

Nov 15, 2017 13:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.