16 Mar 2012
05 Jun 2013
Link to this post
I tried looking through the code in those attachments, and I'm not sure what I'm looking at... There seems to be all kinds of different code in there that isn't doing anything. I would like to provide my implementation but it won't allow me to attach .ZIP files. So here ya go:
In any event, I can provide our implementation which we use. It should function identically to the Module Builder selectors, with the exception of not allowing for multiple selectors for one field (e.g. you can't change it's settings to select multiple images for one field, etc.). And it'll allow for selection of Image, Document OR Video types.
It's setup as an actual module which should make it easier to install the actual fields (Just add the module as you would any other after adding the project, resolving dependencies, adding the reference to your Sitefinity project, and recompiling).
Then usage when adding custom fields just means adding a "Short text" field, using a custom widget, and putting in the namespace for whichever type of selector you want (e.g. NSC.Sitefinity.Modules.AssetPickerFields.ImageField.ImageField).
1. This is dependent on a custom HTML5 video player we also wrote for the "read mode" of the video selector field. You can eliminate that dependency by deleting the video field if you don't need it, or by changing the template for the VideoField to use the builtin Silverlight media player. Our video player implementation actually should implement the same interface, so they should be a drop-in change. Just change the reference to our video player to use Telerik.Sitefinity.Modules.Libraries.Web.UI.Videos.MediaPlayerControl instead (Two changes, one in the template, and one in the code behind for it).
2. I would recommend changing the root namespaces on everything to something more generic, but I'm too lazy to do it for this right now. NSC is our organization root, so all our projects are named after that.
3. I suspect there is a better way to enter these fields into the system so that they are easily selectable when adding a new field instead of having to go through the "Select Short Text, select Custom, enter assembly location for widget" dance. If you figure out how to do it, let me know, as I would have loved to have done that with our implementation, but never got a straight answer on how to do it.
4. I take no responsibility for this. If someone wants to take it and run with it / create an actual community module for it, etc., be my guest. I hope someone does this, in fact, because maybe it'll light a fire to get an official implementation in.
5. This is just the source code / project file. I will not compile it for you. Have fun.