1

I am using several document library web parts and I want to hide the "Add new document" link on those web parts. How can this be done?

  • would it work to remove the add permissions to the document library? – Ryan Erickson Apr 1 '13 at 21:51
1

Add the following style in your CSS file or in your Master page (between style tags),

<style type="text/css">

.ms-addnew
{
  display: none !important;
} 

#MSOZoneCell_WebPartWPQ2 .ms-addnew  /* for a particular web part */
{
  display: none !important;
}
</style>
  • 2
    C. Marius's answer is the correct one, the UI gives you these tools, no need to use CSS for this, as it would affect every web part everywhere that this CSS is attached to which might not be desired. With it being in the master page, you've just disabled this functionality within the entire site/site collection. – Eric Alexander Apr 1 '13 at 23:39
8

...or alternativelly, use the "Edit web part" and choose the option to "No Toolbar" (by default it is "Summary Toolbar" - which translates in showing the "Add new item" button for people with appropriate permissions mask)!

1

For SharePoint 2013 it's:

.ms-list-addnew
{
  display: none !important;
} 

Just a note - although you can edit the web part to show 'No Toolbar', it's not practical when you have thousands of document libraries/lists to do. In that case CSS is better. If you ever need to change your mind, you can edit the CSS file.

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.