1

I am trying to hide all ribbon tabs in my SharePoint site(check the below image).

I am using delegate control with following piece of code. The code hides ribbon tabs on all the site pages, but not list forms.

SPWeb web = SPContext.Current.Web;
if (!web.UserIsSiteAdmin)
{
   SPRibbon current = SPRibbon.GetCurrent(this.Page);
   if (current != null)
   {
      current.CommandUIVisible = false;
   }
} 

I also tried following piece of code to see if I can hide the entire ribbon only on the list form by checking for existence of list form specific tabs, display form for example, but current.IsTabAvailable(SPRibbon.ListFormRibbonDispTabId)) returns false.

if (current.IsTabAvailable(SPRibbon.ListFormRibbonDispTabId))
{
  current.Visible = false;
}

How do I hide ribbon tabs on the list forms? Is there a way to check if the page is list form? How do I check if specific tab is available?

enter image description here

Answer : Used css to hide the ribbon.

  • 1
    Use this script in Master page. '<script type="text/javascript"> document.getElementById("s4-ribbonrow").style.display = "none"; </script>' – Suren Apr 26 '13 at 11:57
  • @suren s4-ribbonrow hides the full ribbon. I just want to hide tabs. Is there any way i can put this code only on list forms. – Ishan Apr 26 '13 at 12:09
  • Are you looking for this? [chaitumadala.com/2010/04/… – Suren Apr 26 '13 at 12:30
  • The methode in the link to hide ribbon is not feasible as we have many list forms. Need the change to be at one place and reflect everywhere. – Ishan Apr 26 '13 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.