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

TabStrip extension

Vote:
 
Hi! I have build an usercontrol which is placed on the Edit-Panel. Currently this tab is displayed on every page. The tab should only be displayed when a special PageType Property is on that page. Just like the formdata tab only is shown on pages with a FormProperty. How do i achieve this? Best Regards, Christian Grønbæk Jørgensen, Denmark
#13019
Apr 25, 2007 11:37
Vote:
 
Hi Christian! Just implement the ICustomPlugInLoader interface, and in the List() method you simply check the undrlying pagetype, and if its not yuore expected type, return an empty PlugInDescriptor array, otherwise return an array containging your plugin. Something like this: [ GuiPlugin(...)] public class MyEditPlugIn : UserControlBase, ICustomPlugInLoader { public PlugInDescriptor[] List ( ) { if ( !CurrentPage.PageTypeName == "MyPageType" ) return new PlugInDescriptor[0]; else return new PlugInDescriptor[1]{PlugInDescriptor.Load(typeof(MyEditPlugIn))}; } .. } Regards, Johan
#15259
Apr 25, 2007 14:02
Vote:
 
This doesn't seem to work for me.. inside the List()-procedure CurrentPage and also this.Page is null so I can't check the type of it.. I guess the UserControl is not actually loaded by my template page (but instead by some logic which builds the edit panel) when I am in edit mode..? Or why doesn't it work..?
#22456
Aug 05, 2008 17:08
Vote:
 

Any update on this.. As i have same issue.. i want to hide one of custom tab in specific pagetype based on some condition. I dont know how to access the custom tab through code.

#57059
Feb 23, 2012 10:59
Vote:
 

This should get you started.

public class TabRemover : PlugInAttribute
    {
        public static void Start()
        {
            EPiServer.UI.Edit.EditPanel.LoadedPage += EditLoaded;
        }

        public static void EditLoaded(EditPanel sender, LoadedPageEventArgs e)
        {
            if (e.Page.PageTypeName == "News Archive Page")
            {
                if (e.Page.Property["PageCategory"] != null)
                {
                    e.Page.Property["PageCategory"].DisplayEditUI = false;
                }
            }
        }
    }

    

#57105
Feb 25, 2012 1:48
* 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.