5

I have a custom masterpage. How can I hide some buttons in the ribbon like:

Open in explorer

enter image description here

and send file

enter image description here

3

EASY solution is the CSS. Just inspect element from browser and apply some css like

display: none;

enter image description here

If you need this across the site, then add these style into your master page. If you need this for a specific library only, then add these into that specific page using Content Editor Web Part. You can use this plugin in Chrome for generating css.

0

An an example this selector works for selcting open with explorer. you can use similar method to select other elements

.ms-cui-tabBody li:nth-child(5)  .ms-cui-row:nth-child(2){display:none;}
0

Using id in the selector we can hide the button as follows,

jQuery("Ribbon.Documents.Copies.ManageCopies-Medium").hide();

jQuery("Ribbon.Documents.Copies.SendTo-Medium").hide();

jQuery("Ribbon.Library.Actions.OpenWithExplorer-Medium").hide();

0

I hided these buttons as follow. I created a feature and an elements.xml. Inside this elements.xml I added:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.Copies" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>

  <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Library.Actions.OpenWithExplorer" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>

</Elements>

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.