ASPX templates
Version 5.x > ASPX templates > Editing items via Media Gallery control? View modes: 
User avatar
Certified Developer 9
Certified Developer 9
Dylan - 1/19/2011 11:02:44 AM
   
Editing items via Media Gallery control?
Hello,

I've currently set up a media gallery and am pulling images via a custom Transformation. Is it possible to set up a simple "Remove Image" button/link for each Image that displays in the gallery? Is there a control for this?

Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/20/2011 7:35:49 AM
   
RE:Editing items via Media Gallery control?
Hello,


regrettably, we do not have a built in functionality for this purpose. The editors can delete the media files in CMSDesk.

However, you could create a custom control which can contain a delete link with media file identification and then you can delete the media file by API. For example:

CMS.MediaLibrary.MediaFileInfoProvider.DeleteMediaFileInfo(int mediaFileId)

You can register the control in the transformation like for example ShoppingCartItemSelector: Adding ShoppingCartItemSelector control to the transformation.

You can see the API Reference for more methods.


Best regards,
Helena Grulichova

User avatar
Certified Developer 9
Certified Developer 9
Dylan - 1/20/2011 11:01:56 AM
   
RE:Editing items via Media Gallery control?
CMS.MediaLibrary.MediaFileInfoProvider.DeleteMediaFileInfo(int mediaFileId)


Since I've created my own Image Gallery control and binding images from a DataSet I think this will work perfectly.

Thanks!