SharePoint 2013/2010 -Go Up folder in Document Library
Issue:Some time when we customize the tile/navigation/breadcrumb, the link to document folder go up folder by will go missing. Here is a simple hack for it.
Resolution:
Just paste this code in content editor or script editor, and add an image suitable with updating the link.
PS: correct the links of folder to you library and site location. (highlighted part)
<script type="text/javascript">
function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));}
function GoUPFolder(){
if(getParameterByName('RootFolder')!="" && getParameterByName('RootFolder')!= "/teams/site/doclib"){
var url = getParameterByName('RootFolder').split("/");
var upfolder="";
for( var i=1; i< url.length-1; i++)
{upfolder=upfolder+"/" + url[i];}
window.location.href = "/teams/site/doclib/?RootFolder=" + upfolder;}
else{window.location.href = "/teams/site/doclib";}
}
</script>
<div id="divUpLink">
<img onclick="GoUPFolder();" style="cursor: pointer;" src='/teams/site/images/UpButton.gif'/>
</div>
Happy Browsing!
Relax..
Relax..