Hide new media-provider in hyperlinks editor

Vote:
 

I added some extra media-providers which work properly. The provider and it's file location now also show up in editor windows like the Hyperlink window. How can i prevent it from showing up in the Hyperlink window?

#142846
Jan 04, 2016 11:04
Vote:
 

Hi,

In your class, that implements IContentRepositoryDescriptor, can you override LinkableTypes and return null.

[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 }; }
    }
}
#142847
Jan 04, 2016 12:13
Vote:
 

Excellent! That solved the problem and made my day. Thanks!

#142848
Jan 04, 2016 12:24
Vote:
 

Please mark the solution as answered :)

#142849
Jan 04, 2016 12:26
Vote:
 

Sweet! I was just looking for that. Overriding the link EditorDescriptor for link was really messy.

#144226
Feb 09, 2016 14:16
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.