Try our conversational search powered by Generative AI!

Interface ICustomPlugInLoader

Override the default behavior when plug-ins are loaded

Namespace: EPiServer.PlugIn
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public interface ICustomPlugInLoader
Remarks

This class may be useful when a single plug-in need to generate multiple items or no items at all depending on custom conditions.

Examples
  The following sample shows how to determine if a plugin should be visible 
  by implementing the ICustomPlugInLoader interface. The plugin will only be 
  shown to users in the Administrators group.
    public class PageUtilPlugin : UserControlBase, ICustomPlugInLoader
{

// implement the ICustomPlugInLoader.List method
public PlugInDescriptor[] List()
{
PlugInDescriptor[] descriptors = null;

// Check if we should show the plugin. We use PageBase.Page since the plug-in has not been added to the page yet 
// which means that the local Page property is still null.
if (PageBase.Page.User.IsInRole("Administrators"))
{
    descriptors = new PlugInDescriptor[1];
    descriptors[0] = PlugInDescriptor.Load(this.GetType());
}
// else return null
return descriptors;
}
}

Methods

List()

List plugins for area

Declaration
PlugInDescriptor[] List()
Returns
Type Description
PlugInDescriptor[]

Extension Methods