Widget with custom controller and inline editor

Jelle Capenberghs asked on July 31, 2019 10:10

Hello,

I am currently building a widget that allows you to select an image from the media library to display on the web page. I have an inline editor that calls a javascript function to open the media library and select an image (the Guid Id). I also have a controller that receives the id from the selected image and then returns the imageUrl to display on the page. But I can't seem to get the selected image Id from the inline editor to my custom controller. Is it possible to combine a custom controller and an inline editor. Because the examples in de documentation use either a custom controller or an inline editor, but not both since they require different models in de widget view.

I hope my question is a bit clear :-) Or if there is a widget that allows you to select an image from the media library to display on the page is already available, that would also be great (so I don't have to build my own...).

Kind regards,

Jelle

Recent Answers


Dmitry Bastron answered on July 31, 2019 10:23

Hi Jelle,

Kentico 12 Service Pack brought media selection inline editor, please check out the documentation.

Also, you can check my article about writing custom media picker and using it in a custom widget. And here is the code example from the article. I hope it will help.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.