Extend LinkItemCollection

Vote:
 

Have someone been able to extend a LinkItemCollection with custom properties such as an Image or an extra text field. This is something that we need in almost every project, and it feels strange that there is no "out of the box" solution for this and that it is so hard to find information about how to extend the LinkItemCollection. 

#131977
Aug 11, 2015 14:33
Vote:
 

See answer to similar question here:
http://stackoverflow.com/questions/16039429/episerver-7-mvc-linkitemcollection-add-images-to-linkitem-collection

#131979
Aug 11, 2015 14:50
Vote:
 

Thanks, I have seen that but dont like the idea to implement it as blocks. For webeditors, the user experience of creating blocks for that task will not be as smooth as it would have been to just use a simple linkItemCollection...

#131981
Aug 11, 2015 16:01
Vote:
 

For images you can create a Contentarea that only allow images, and then have a displaytemplate for rendering. Editors can then drop images into the contentarea, and skip the step creating blocks

[AllowedTypes(new[] {typeof (ImageData)})]
[UIHint("ImageGallery")]
public virtual ContentArea ImagesContentArea { get; set; }
#131998
Aug 12, 2015 7:33
Vote:
 

May be you can get some ideas from this old thread where Anders extended the linkitemcollection property to use visitorgroups.

http://world.episerver.com/blogs/Anders-Hattestad/Dates/2011/6/How-to-make-Property-LinkCollection-use-Visitor-Groups/

#132011
Aug 12, 2015 10:35
Vote:
 

Thanks Tahir, I have seen that, it was easier before when the Admin interface wasnt built with Dojo. I dont think that will work in an Epi8 environment..

#132012
Aug 12, 2015 10:42
Vote:
 

I agree that Dojo is close to witchcraft. ;) However, there is a lot you can do with custom properties without touching dojo. I recommend reading this excellent post by Allan Thræn:
http://world.episerver.com/blogs/Allan-Thran/Dates/2014/6/Strategies-for-Custom-Properties-in-75/

#132013
Aug 12, 2015 10:54
Vote:
 

LinkItemCollection is a very useful property type in EPiServer. However, quite often you need to transform, convert or in some ways prepare a LinkItemCollection before you can use it the way you want to.

#200388
Edited, Jan 11, 2019 5:28
Vote:
 

Have you considered Property List. Gives the content authors more control in a single view than creating a block for each item. 

#200465
Jan 14, 2019 1:06