Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Yes, you can implement the interface EPiServer.PlugIn.ICustomPlugInLoader and then do like this
// Hide/show tab
public PlugInDescriptor[] List()
{
PlugInDescriptor[] descriptors = null;
// Check if we should show the plugin
if (CurrentPage.PageTypeID == Utils.Settings.PageTypePressRelease || CurrentPage.PageTypeID == Utils.Settings.PageTypeFinancialReport)
{
descriptors = new PlugInDescriptor[1];
descriptors[0] = PlugInDescriptor.Load(this.GetType());
}
// else return null
return descriptors;
}
Magic, huh? :)
Hi!
As Erik mentioned, implement the ICustomPlugInLoader interface for your tab-plugin to be able to decide if you want to create a plug-in or not for the current page. See the following example from the forms posting plug-in:
[GuiPlugIn(DisplayName = "XFormdata",
Description = "Show xformdata",
Area = PlugInArea.EditPanel,
UrlFromUi = "edit/XFormPostings.ascx",
LanguagePath = "/edit/formpostings",
RequiredAccess = AccessLevel.Edit)]
public partial class XFormPostings : UserControlBase, ICustomPlugInLoader
...
...
public PlugInDescriptor[] List()
{
if (!PageContainsFormProperties())
{
return new PlugInDescriptor[] { };
}
else
{
return new PlugInDescriptor[] { PlugInDescriptor.Load(typeof(XFormPostings)) };
}
}
Linus Ekström
Hi,
Is there a way for me to control the visibility of a custom tab based on the page type in Edit Mode. For example, I have a custom tab names External sources which is associated with a page type called referecences. If the page type is not this one, I would like to hide it.
Thanks