Module Builder: Programmatically upload and associate image

Posted by Community Admin on 04-Aug-2018 23:02

Module Builder: Programmatically upload and associate image file

All Replies

Posted by Community Admin on 22-Jan-2014 00:00

Hi,

I've created a custom module using Module Builder. This custom module includes a field for uploading an image. I  have created a custom ascx user control that will save items to the new custom module, except for the uploaded image. Is there any documentation related to saving images using the custom module builder types via custom code? I did find documentation on creating images in the library but there is no reference on how to associate the uploaded image with a content item.

thanks

Sitefinity version 6.0

Posted by Community Admin on 27-Jan-2014 00:00

Hello,

You have the ability to add a custom field for your custom module of type Media (images, videos, files).

http://screencast.com/t/CtpFIpJ2

Then choose what kind of media this field will manage and save the changes. If you have a pop up which asks you

Are you sure you want to save the changes to this content type?


Check Update widget templates as well and click Yes, save the changes.

After that when you create an item of the module you will have an image selector:

http://screencast.com/t/iisji3mRdO

This is how you should associate an item with an image.

After the item is created and the widget is dropped on the page, you could see the item and the image in the details view of the item. The field is added automatically to the details template.

screencast.com/.../3DvAwC1L

If you want to add it to the list template you need to go to the properties of the widget, navigate to List settings, choose the template and add the AssetsField there (copy it from the details template).

Regards,
Stefani Tacheva
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 Public Issue Tracking system and vote to affect the priority of the items

This thread is closed