# Library web part - link behavior - make link open in window, not web part

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!

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>

• @J.Lo Did this solution work for you? – Sagar Jan 18 '18 at 3:04
• 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.Lo Feb 12 '18 at 19:11