Tested in SharePoint 2013, 2016 and SharePoint Online.
The Windows Explorer view of a SharePoint library has so many issues that I'm often asked to hide it. Turns out that this is pretty easy to do. Two solutions:
- Create a SharePoint Feature and deploy it to the desired site collections.
- Add CSS to your master page, or to selected view pages.
Create a SharePoint Feature and deploy it to the desired site collections
This is the best solution! And it's been documented elsewhere: https://blogs.msdn.microsoft.com/tejasr/2010/07/19/how-to-remove-open-with-windows-explorer-button-from-document-librarys-ribbon-menu/
I would only add one more step to this solution… make sure the WSP file does not include an unneeded DLL so the solution can be deployed to SharePoint Online. (No code allowed!) The one extra step: In the project's Properties panel click "Include Assembly in Package" and change it to False.
Once the Feature has been installed in the Site Collection, just visit each subsite and activate the feature. This will impact all libraries in the site.
Add CSS to your master page, or to selected view pages
Add one little piece of CSS to your master page, or open SharePoint Designer and edit the library's views to add a CSS block and the button will disappear. If added to the master page then this will impact every library in the site. If added to a view page, then it will impact only that view.
This CSS will not work with the SharePoint Online “New Library Experience”. But then the new “experience” does not currently include a link for Windows Explorer!
The CSS:
<style type="text/css"> #Ribbon\.Library\.Actions\.OpenWithExplorer-Small { display: none; } </style>
Note: The backslashes have been added to the ID due to the non-standard naming convention that uses periods.
If you would like site owners to still be able to see the button then wrap additional CSS in a SharePoint:SecurityTrimmedControl. Note that this control can only be added directly to a page, typically using SharePoint Designer. It will not work if added to a Content Editor Web Part.
<style type="text/css"> #Ribbon\.Library\.Actions\.OpenWithExplorer-Small { display: none; } </style> <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb"> <style type="text/css"> #Ribbon\.Library\.Actions\.OpenWithExplorer-Small { display: inline; } </style> </SharePoint:SPSecurityTrimmedControl>
.
No comments:
Post a Comment
Note to spammers...
Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.