Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Custom Content Provider in EpiServer add-on, The content is not displayed in the asset pane


I am working on a content provider that is packaged as an add-on. The provider succeeds in creating all content and I can see it in Admin -> Set Acces Rights, and I can see the tab in the asset panel. But in the area where the folder structure will appear, I often get up folders from the other tabs "For all sites" etc. Sometimes, however, the provider works as intended and my contents appear as it should. Is there anyone else who has encountered this?

I've followed this guide to create the add-on

And this for the content provider

The Component

    class AssetComponent : ComponentDefinitionBase
        private static readonly ILogger Logger = LogManager.GetLogger();
        public AssetComponent() : base("epi-cms/widget/HierarchicalList")
            var settingsHelper = new SettingsHelper();
            var settings = settingsHelper.GetSettings();

            string tabName = settings.TabName;
            Categories = new string[] { "content" };
            Title = tabName;
            Description = "Displays external assets";
            SortOrder = 1000;
            PlugInAreas = new[] { PlugInArea.AssetsDefaultGroup };
            Settings.Add(new Setting("repositoryKey", AssetProvider.Key));

The RepositoryDescriptor

    class AssetRepositoryDescriptor : ContentRepositoryDescriptorBase
        protected Injected ContentProviderManager { get; set; }
        public override string Key => AssetProvider.Key;
        public override string Name => "DAL";

        public override IEnumerable Roots => new[] { ContentProviderManager.Service.GetProvider(AssetProvider.Key).EntryPoint };
        public override IEnumerable ContainedTypes => new[] { typeof(Asset), typeof(AssetImage), typeof(AssetDocument), typeof(AssetMultimedia) };
        public override IEnumerable MainNavigationTypes => new[] { typeof(ContentFolder) };

        public override string SearchArea => AssetProvider.Key;
        public bool ChangeContextOnItemSelection => true;

This is the first time I make an addon and I'm not so familiar with Dojo and javascrip in EpiServer so all help is appreciated.

Dec 20, 2017 17:55

Might be completely unrelated but I had a similar issue when I replaced the catalog search provider, sometimes it would use my provider and sometimes the old one.

I finally figured it out and got around it by implementing ISortable and setting a low SortOrder. The standard providers didn't implement the interface at all and got a default SortOrder.

It's a long shot but it sounded so familiar so thought I should mention it. embarassed

Dec 21, 2017 10:45

Which version of Episerver are you running?

Try using "epi-cms/asset/HierarchicalList" instead. "epi-cms/widget/HierarchicalList" has been deprecated for some time, and removed in EPiServer.CMS.UI 11.1.0.

Dec 22, 2017 10:03

Thanks for the advice, I tried to change the order of components, but as i did it i got an error in another part of the addon:

Server Error in '/' Application. There is no build provider registered for the extension '.cshtml'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.

So i found this:

And setting optimizeCompilations to false in web.config (in the project that the addon is installed in) made the problem go away. 
Edited, Jan 02, 2018 16:17
Jan 17, 2018 10:47
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.