I'm using SP 2013 library web parts on my sites. The web part displays folders, when the folders are clicked, it opens the folder inside of the web part (like a preview). We would like the links displayed in the library Web part to open the folders in a window, not inside the web part. Thanks for your suggestions!
1 Answer
You will need to override the HandleFolder javascript method in order to achieve this. Please paste below code in a Content editor webpart on your page and the folders should open in new tab.
<script>
function HandleFolder(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) {
var parts = new Array();
parts = c.toLowerCase().split('%2f');
c = c.replace('SitePages/Home.aspx',parts[1]);
window.open(c);
return false;
}
</script>
Reference - https://amalhashim.wordpress.com/2013/12/03/sharepoint-2013-open-folder-in-new-window/
-
-
Unfortunately it did not work in my case. I eneed up adding a breadcrumb to the web part so that there would be some sort of navigation for the intent displaying inside.of the web part.– J.LoCommented Feb 12, 2018 at 19:11