Try our conversational search powered by Generative AI!

Customization of settings for LinkItemCollection

Vote:
 

Hello!

Is there a way to customize how the dialog for adding a new link is presented to the editor in properties of type LinkItemCollection? (Episerver 8)

Say if the client does not want the "Link name/text" to be mandatory, is there a way to customize or override this?

Thanks in advance!

/Kenia

#145930
Mar 15, 2016 18:12
Vote:
 
#145931
Edited, Mar 15, 2016 18:35
Vote:
 

Thanks Daniel. I'm familiar with EditorDescriptors, we don't want to build though a Dojo property for this. But there might actually not be a way to customize the dialog for adding links to the LinkItemCollection.. at least I've search and still haven't found any.

#145932
Mar 15, 2016 20:37
Vote:
 

My best guess is to use dotPeek and modify Episervers own implementation and smack a UIhint on the property. Might be a better way but not that I know of...

#145933
Mar 15, 2016 21:37
Vote:
 

Hi, Kenia,

I'd suggest you to take a slightly different approach, it will be way less time and cleaner as well. I don't think you'll be able to fully customize built-in properties, especially those that are somewhat legacy from older versions, like LinkItemCollection.

Create a block called Link and give it the properties you need, ex. Url, Target and Name/Title. Then create a simple rendering of <a> tag and add content area to the page instead of LinkItemCollection. You can then decorate Name/Title with [Required].

If you'd like to still want to have all of the exactly the same features as LinkItemCollection or you already have some field filled in, I am afraid you'll need to go with something similar to this:

http://www.mogul.com/About-Mogul/Blog/Extending-EPiServer-link-in-TinyMCE-to-support-anchors-on-page/

If you are lucky, something like this:

http://www.mogul.com/Documents/Blogg/EPi7/TinyMCEAnchors/ExtendedEPiLinkConfigurationHandler.cs.txt

+

http://www.mogul.com/Documents/Blogg/EPi7/TinyMCEAnchors/ExtendedEPiLinkModel.cs.txt

with [Required] on the property you want required might do the trick (but I would expect the dojo part will also not contain clientside logic that won't work the way you expect it, so you'd need to inherit/override the widget, but that might go down the path of endless rewriting).

The third option is adding custom validation server side that would be triggered only after the page is saved, but would allow you to prevent the editor from publishing a page that has empty titles, if that's good enough.

BR,

Marija

#146484
Mar 16, 2016 13:48
Vote:
 

Hi Marija!

That was a bunch of good suggestions! Thank you!

I think the idea of just replacing the LinkItemCollection with a ContentArea and creating a block type with similiar properties as LinkItem is the simplest and most flexible solution. Trying to extend the property and the Dojo-widget sounds like lots of work that can be achieved in easier ways.

Unfortunately the client set low priority on this se we dropped it.

Cheers,

/Kenia

#147297
Apr 11, 2016 9:29
Vote:
 

Glad I could help :)

#147302
Apr 11, 2016 13:15
Vote:
 

Is there a simple way to customize the LinkItemCollection to only accept page references?

#171068
Nov 01, 2016 10:08
Vote:
 

Check out the ContentReferenceList property type instead. You can restrict that one to only accept certain content as well...

#171070
Nov 01, 2016 10:26
Vote:
 

Excellent! Thank you, @Daniel.

#171072
Nov 01, 2016 10:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.