Adding RelatedMediaField to Custom Module

Posted by Community Admin on 05-Aug-2018 21:21

Adding RelatedMediaField to Custom Module

All Replies

Posted by Community Admin on 20-Mar-2016 00:00

I am trying to add a RelatedMediaField to the detail control, and unable to determine how I should be getting a script reference to the control.

If this was a widget designer there would be some changes to "GetScriptDescriptors" and the js file to wireup the control references, but the simpleview control for the custom module does not have that function.

I wasn't able to find any kind of on init function I could tap into like the HtmlField control has, so I don't know how to wire it in.

 

Posted by Community Admin on 23-Mar-2016 00:00

Hello Michael,

You can use SimpleScriptView instead of SimpleView to inherit from. SimpleScriptView implements IScriptControl interface which will give you access to GetScriptDescriptors and GetScriptReferences methods to wire up client side logic.

Regards,
Pavel Benov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 24-Mar-2016 00:00

that is what I was looking for, and based on sample code I have for widget designers I can take it the rest of the way.

My remaining question is where is this documented? I suspect I missed it, but it seems the correct way to make a complete custom module is missing steps in the documentation.

Posted by Community Admin on 25-Mar-2016 00:00

Hello Michael,

We have an article that mentions the 2 base classes which you can inherit from when creating your own controls:

http://docs.sitefinity.com/for-developers-create-a-new-custom-widget

Sample implementation on SimpleScriptView:

http://docs.sitefinity.com/image-selector-for-content-items-implement-the-server-widget

Looking at those however I can see where the confusion comes from, so I have placed a Documentation enhancement request, so that we can provide a bit more information on those 2 classes in the first article as well as links to the different samples of their implementation, so that it can be found easier.

Regards,
Pavel Benov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 29-Mar-2016 00:00

Are there samples that cover how to take the thunder created simple view script file to work with a simplescriptview?

Posted by Community Admin on 29-Mar-2016 00:00

Hello Michael,

Thunder uses SimpleView as a base class for the controls it generates and for now there is no option to switch it to use SimpleScriptView.

When you generate the control, just manually change that base SimpleView to SimpleScriptView and implement the required GetScriptDescriptors and GetScriptReferences methods

I have attached a simple control implementing SimpleScriptView which you can check.

Regards,
Pavel Benov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed