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

Hide custom Content Provider from Content Selctor?

Vote:
 

Hi,

I developed a custom content provider that is being uside in RHS panel. Is it to hide it from the content selector popup? If so, what's the best way go implement it - maybe a custom unit hint / editor descritor?

Many thanks,

Maciej

#144161
Feb 08, 2016 17:26
Vote:
 

You can configure content providers capabilities in web.config

http://world.episerver.com/documentation/items/developers-guide/episerver-cms/75/content/providers/Configuring-Content-Providers

#144166
Feb 08, 2016 17:37
Vote:
 

Hi,

I am not sure if I was clear enough. I would like contentselctor not to display my provider in the content selector:

Hope it makes sesne now.

M

#144168
Feb 08, 2016 17:53
Vote:
 

My best guess would be a new EditorDescriptor and ui hint yes.

Pretty much config needed for the basic plumbing for this property. Good start to check out

http://world.episerver.com/blogs/Anders-Hattestad/Dates/2015/2/extending-the-hyperlink-with-custom-field/

Restricting allowed types on contentselector is probably the easiest way?

Pretty new feature that one so check that it's available for your version before trying :)

#144179
Feb 08, 2016 23:52
Vote:
 

Please see my answer in this thread http://world.episerver.com/forum/developer-forum/-EPiServer-75-CMS/Thread-Container/2016/1/hide-new-media-provider-in-hyperlinks-editor/. I will also post the code here if the link would end up broken in the future.

Return null for LinkableTypes in your MediaRepositoryDescriptor.

[ServiceConfiguration(typeof(IContentRepositoryDescriptor))]
public class YourRepositoryDescriptor : MediaRepositoryDescriptor
{
    private readonly IContentProviderManager ProviderManager;
 
    public YourRepositoryDescriptor(IContentProviderManager providerManager)
    {
        this.ProviderManager = providerManager;
    }
 
    public static new string RepositoryKey { get { return YourSettings.ProviderKey; } }
 
    public override string Key { get { return RepositoryKey; } }
 
    // Disble in link dialog
    public override IEnumerable<Type> LinkableTypes { get { return null; } }
 
    public override string Name { get { return YourSettings.ProviderName; } }
 
    public override string SearchArea { get { return RepositoryKey; } }
 
    public override IEnumerable<ContentReference> Roots
    {
        get { return new[] { this.ProviderManager.GetProvider(YourSettings.ProviderKey).EntryPoint }; }
    }
 
    public override IEnumerable<Type> ContainedTypes
    {
        get { return new[] { typeof(YourMediaFolder), typeof(YourMediaItem }; }
    }
}
#144181
Feb 09, 2016 0:08
Vote:
 

I agree with Johan

#144228
Feb 09, 2016 14:18
* 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.