SaaS CMS has officially launched! Learn more now.

Ha Bui
Apr 13, 2018
  3002
(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 release SaaS CMS

Discover the future of content management with Optimizely SaaS CMS. Enjoy seamless updates, reduced costs, and enhanced flexibility for developers...

Andy Blyth | Jul 17, 2024 | Syndicated blog

A day in the life of an Optimizely Developer - London Meetup 2024

Hello and welcome to another instalment of A Day In The Life Of An Optimizely Developer. Last night (11th July 2024) I was excited to have attended...

Graham Carr | Jul 16, 2024

Creating Custom Actors for Optimizely Forms

Optimizely Forms is a powerful tool for creating web forms for various purposes such as registrations, job applications, surveys, etc. By default,...

Nahid | Jul 16, 2024

Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024