Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
I'm having the exact same problem. Did you ever find a solution to this ?
Se my reply in http://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2016/7/content-provider---problems-with-edit-ui for a solution/workaround to this.
Hi. I've been away on holiday so I haven't had the chance to reply. I guess you have found the answer. I fixed the problem by inheriting from MediaComponent instead of ComponentDefinitionBase (and remebering to set the repository key by updating "repositoryKey" and not adding it). But I see now that this wasn't the actual fix. By chance I also changed the repository key to lower case which fits the thread you are linking to.
I'm working on a project that has a lot of content folders in a hierarchy that makes it a bit diffucult to navigate. My idea is to add a new navigation pane, as Episerver.Forms does, to the asset widget. For this purpose I've created a IContentRepositoryDescriptor:
[ServiceConfiguration(typeof (IContentRepositoryDescriptor))] public class CourtFolderRepositoryDescriptor : ContentRepositoryDescriptorBase { public CourtFolderRepositoryDescriptor() { } public static string RepositoryKey { get { return "YourCourts"; } } public override string Key { get { return RepositoryKey; } } public override string Name { get { return "Court Folders"; } } public override IEnumerable Roots
{
get
{
var courtsAssetFolder = new ContentReference(6);
var courtShortName = "da";
var courtAssetFolder = ServiceLocator.Current.GetInstance().GetChildren(courtsAssetFolder)
.FirstOrDefault(folder => string.Equals(folder.Name, courtShortName, StringComparison.OrdinalIgnoreCase));
return new[] { courtAssetFolder.ContentLink };
}
}
public override IEnumerable ContainedTypes
{
get
{
return new[] { typeof(MediaData), typeof(ContentFolder) };
}
}
public override IEnumerable MainNavigationTypes
{
get
{
return new[] { typeof(ContentFolder) };
}
}
public override IEnumerable CreatableTypes
{
get
{
return new[] { typeof(MediaData), typeof(ContentFolder) };
}
}
and a Component:
[Component] public sealed class CourtFolderComponent : ComponentDefinitionBase { public CourtFolderComponent() : base("epi-cms.widget.HierarchicalList") { Categories = new[] { "content" }; LanguagePath = "/components/courtfolder"; SortOrder = 1000; PlugInAreas = new[] { PlugInArea.AssetsDefaultGroup }; Settings.Add(new Setting("repositoryKey", CourtFolderRepositoryDescriptor.RepositoryKey)); } }
The contents of the asset folder returned as root won't load however. Can anybody spot the problem?
Regards,
Bjørn Terje Svennes