November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Using the LinkItemCollection is one option. Another option is to have a URL to folder property. Then you can have all the images that you would like displayed in the slider within the folder that the property points to. There is no built in URL to folder property but it is pretty easy to add one. If you want to try that option I can post some code snippets.
Yes please post a example on how that works with the folder.
The reason why I don't like LinkItemCollection to go with is because I only want the editor to select images and not be able to add a document or just a link so it will fail the javascript slider outcome. If you find out a solution for this before I do, please contribute with it. :)
Hey Daniel,
Unfortunetly Ha Bui has a habit of posting code for versions of EPiServer that haven't been released yet ;) so his example wont work in your case.
The solution that I suggested with the URL to Folder property makes use of the existing file picker from the legacy UI but we tell it that we only want to be able to select folders. Otherwise it functions like any other URL property. So on your model you would have a property like this:
[UIHint("Folder")]
public virtual Url FolderUrl { get; set; }
The UIHint is important here as it tells the UI what editor to use. This mapping is done via an EditorDescriptor object. In this case we create one to map a property of type Url with a UIHint of Folder to the FileSelector:
[EditorDescriptorRegistration(TargetType = typeof(Url), UIHint = "Folder")]
public class FolderUrlEditorDescriptor : EditorDescriptor
{
public FolderUrlEditorDescriptor()
{
ClientEditingClass = "epi-cms.widget.FileSelector";
EditorConfiguration["fileBrowserMode"] = "folder";
}
}
Hopefully that is all you need to get the property working. After that, in your controller, you can load up the value of the property as a UnifiedDirectory and get the files contianed within.
Let me know if you have any problems.
I found this plugin that worked out the way I wanted.
http://nuget.episerver.com/en/OtherPages/Package/?packageId=MakingWaves.EPiImage.LegacyEPi7
@Ben
This doesn't seem to work with EPiServer 7.5 - perhabs the client editing class is changed?
How can I declare my property in my class that I want to have a list of images? As of now I can only think about using LinkItemCollection, but that dosen't seem to be a good way. I only want to be able to select images. This property is going to be used for a image slider.