November Happy Hour will be moved to Thursday December 5th.

Ha Bui
Apr 13, 2018
  3112
(13 votes)

Custom model for LinkItemCollection property

In many CMS project, we have many requirements that use LinkItemCollection property but with customize model (default is LinkItem).

Below is the way we do:

  1. Define property with type LinkItemColleciton in your content type like this:

Image Step1_Add_Property.JPG

2. Add new EditorDescriptor like this:

Image Step2_Add_Custom_Editor_Descriptor.JPG

3. Add new .js file for your custom model like this (match with the path in step 2):

Image Step3_Add_Custom_Item_Model.JPG

3. The last step is HACK way, because of item collection editor need the model above injected from the beginning (@EPiServer guy: should be improved by lazy load !?)

Image Last_Step.JPG

That all!

Apr 13, 2018

Comments

Dang Viet Hung
Dang Viet Hung Apr 16, 2018 04:31 AM

Nice article!

In the past, when our team have to custom LinkItemCollection, i often use builtin PropertyList property of EPIServer. Of cause, it take time than i think and hard to maintain:)

Thank a lot 

Alex Do
Alex Do Apr 16, 2018 05:07 AM

Great post, thank you for sharing. 

Thien
Thien Apr 16, 2018 05:12 AM

thanks for sharing.

Deepa Puranik
Deepa Puranik Jan 28, 2022 08:18 AM

Will this work for adding new field for link item collection?

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog