Try our conversational search powered by Generative AI!

Extending LinkItem

Vote:
 

I have created a derived LinkItem class in order to extend it and add additional properties.  I extended LinkItemCollection, and my custom property displays in the editor view of the page and the built-in LinkItemCollection control is displayed, but none of my custom LinkItem derived Properties are available in the editor.  

I took Jon Jones post http://jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-properties/episerver-how-to-render-a-list-of-objects-in-a-page-or-block-propertylist-explained

and adapted it to create a collection of LintItemCollections (yes a collection of collections of Links). This allows the editor to build any number of linkcollections on their page. I then wanted to extend the LinkItem to add additional properties to determine how the link would render. I successfully subclassed LinkItem and LinkItemCollection and have a class that derives from PropertyList that is a collection of my derived LinkItemCollection, and all this renders in the editor view of the page, BUT my custom properties in my derived LinkItem class do not display in the editor. My custom properties in the derived LinkItemCollection appear, but then when you edit an individual link, it displays the original built-in LinkItem Editor without my custom derived LinkItem Properties. Any ideas?

#176838
Mar 28, 2017 23:13
Vote:
 

Hello Willman, 

Did you figure this approach out in the end? I'm considering following a similar approach for a build and would like to know if it's a dead-end.

Thanks in advance

#199870
Dec 14, 2018 17:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.