November Happy Hour will be moved to Thursday December 5th.

Content Provider not working when using "epi-cms/asset/HierarchicalList.

Vote:
 

I have a content provider where I used the epi-cms/widget/hierarchicalList for component.
When I change to the new "
epi-cms/asset/hierarchicalList" I get an error, the folder structure is displayed but the content/assets are not.
I get the following error when trying to select a folder

Uncaught TypeError: Cannot read property 'single' of null

in the epi-cms/asset/view-model/HierarchicalListViewModel.

/Johan

#187397
Edited, Jan 22, 2018 14:41
Vote:
 

Trying to solve the same issue.

To me it seems that epi-cms/asset/hierarchicalList is a base component that needs to be inherited in your own custom widget, which makes the description in CMS-8817 misleading. 

You either need to make a custom component that extends the HierarchicalList and adds, amongst others, the noDataMessage or you can try this quickfix:

  • Make you component C# class inherit from EPiServer.Cms.Shell.UI.Components.SharedBlocksComponent
  • Set the LanguagePath to override the default resource for Title
    [Component]
    public sealed class MyComponent : SharedBlocksComponent
    {
        public MyComponent()
        {
            Categories = new[] { "content" };
            Title = "My";
            LanguagePath = "/components/my";
            SortOrder = 1000;
            PlugInAreas = new[] { PlugInArea.AssetsDefaultGroup };
            Settings.Add(new Setting("repositoryKey", MyProvider.Key));
        }
    }
#187449
Jan 23, 2018 11:10
Vote:
 

Good suggestion, i went for the workaround and used another component instead. I did not get the languagePath thing to work in my context so i used the media component instead.

    [Component]
   public class AssetComponent : ComponentDefinitionBase
    {
      
        public AssetComponent() : base("epi-cms/component/Media")
        {      
            Title = tabName;                   
            Categories = new string[] { "content" };      
            SortOrder = 1000;
            Description = "Displays external assets";
            PlugInAreas = new[] { PlugInArea.AssetsDefaultGroup };
            Settings.Add(new Setting("repositoryKey", AssetProvider.Key));
        }
    }   



#187946
Edited, Feb 07, 2018 9:07
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.