Hiding Category Tab

by: Mari Jørgensen

 

Ever wanted to hide the default Categories tab in editmode? Well, with EPiServer CMS 5 and the EditPanel LoadPage event, you can! Smile

public class Global : EPiServer.Global
{
   protected void Application_Start(Object sender, EventArgs e)
   {
       EPiServer.UI.Edit.EditPanel.LoadedPage += 
new EPiServer.UI.Edit.LoadedPageEventHandler
(EditPanel_LoadedPage); } void EditPanel_LoadedPage(EPiServer.UI.Edit.EditPanel sender,
EPiServer.UI.Edit.LoadedPageEventArgs e) { //make sure property exists before set visible to false if (e.Page.Property["PageCategory"] != null) e.Page.Property["PageCategory"].DisplayEditUI = false; }
}
(You need to add a reference to the EPiServer.UI.dll)

18 January 2008

Tags:


    Comments

    1. Sweet! Thanks for the tip!
    2. Except for that the hidden tab comes up again if you press the "Save" button (not "Save and show" or "Save and Publish") or if you didn't fill some mandatory fields and get a validation summary on top of the edit page. Do you have a solution covering those two cases also?
    3. Evidently not.
    4. http://world.episerver.com/Forum/Pages/thread.aspx?id=21596
    5. The forum thread doesn't resolve the issue. Anyone have any ideas for a workaround here? Even a crude hack of sorts would be appreciated.
    6. Tried the same code in R2, but with the same result. I'll make sure that this is reported as a bug.
    7. Johan from EPiServer has now updated the forum thread with a hack that fixes this.
    Post a comment    
    User verification Image for user verification  
    EPiTrace logger