Translate interface for IList<ContentReference> AllowedTypes


Hello, is it possible to translate/change the name displayed when using the AllowedTypes with an interface?
It works for pages, but when using an interface it will print the interface namespace, can I change that?

May 04, 2016 16:51


It is simple to support pretty names and localized values as part of Episervers 'Allowed Types'. Be aware that below change will apply to all properties where Episerver internally uses the epi-cms/contentediting/AllowedTypesList - e.g. the ContentReferenceListEditor you are showing above.

First of all, you have to register a UIDescriptor for your interface.

public class ContentDetailPageDescriptor : IDescriptor<IContentDetailPage> { }

Next step is to add the localized name to a resource file available to the Localization System in Episerver.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <language name="English" id="en">
          <name>Content Detail Pages</name>

Remember to adjust the language name and id to match your Swedish locale.

End result speaks for it self.

Hope it helped.

Casper Aagaard Rasmussen

Edited, May 07, 2016 15:18

Nice, thank you. However, when I create a PageDescriptor that inherits from UIDescriptor<IContainable> I get an error when clikcing on the Browse button. Drag and drop works though.
Internal server error Method EPiServer.Core.DefaultContentRepository.GetChildren: type argument 'SthlmStad.AreaWebs.Lib.EPi.Containables.IContainable' violates the constraint of type parameter 'T'.
We are using version 9.0.3 of CMS and 9.2.0 of UI...

May 09, 2016 13:21


Your interface has to inherit from IContent. That is required due to Episerver's constaints in e.g. the ContentRepository interface.

Hope that helped you with the last detail.

Casper Aagaard Rasmussen

May 09, 2016 13:48

aaah now it works, thanks man! Where did you find this information btw? It feels like I've looked everywhere... :)

May 09, 2016 15:07


Good news! :-)

I am not sure if its documented anywhere. I've been decompiling the Episerver libraries and widgets a lot through the years, which is where I have the information from.

Casper Aagaard Rasmussen 

May 09, 2016 15:13
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.