London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi,
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.
[UIDescriptorRegistration] 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"?> <languages> <language name="English" id="en"> <contenttypes> <icontentdetailpage> <name>Content Detail Pages</name> </icontentdetailpage> </contenttypes> </language> </languages>
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
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...
Hi,
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
aaah now it works, thanks man! Where did you find this information btw? It feels like I've looked everywhere... :)
Hi.
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
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?