Translate

Saturday, October 26, 2013

A few Random development tricks - slighted trickery


CSS to block quicklaunch etc.


<style>
.ms-quicklaunch
{
display:none;
}
.ms-navframe
{
display: none;
}
.ms-globalTitleArea {
display: none;

}
</style> 

The following code is for a sharepoint redirect, just add it to a content editor web part

<meta http-equiv="refresh" content="10;url=http://MYSERVERNAME.com/Pages/default.aspx">

This code, below, taken from http://pathtosharepoint.com  will ADD the quicklaunch using a CEWP

<!-- Load and display Quick Launch - iframe version -->
<!-- Questions and comments: Christophe@PathToSharePoint.com -->
<!-- Paste the URL of the source page below: -->

< iframe id="SourcePage" style="display:none;" src="http://[YourSite]/default.aspx" onload="DisplayQuickLaunch()"></iframe>
<script type="text/javascript">
function DisplayQuickLaunch()
{
var placeholder = document.getElementById("LeftNavigationAreaCell");
var quicklaunchmenu = null;
var SourcePage = document.getElementById("SourcePage");
try {
   if(SourcePage.contentDocument)
      // Firefox, Opera

      {quicklaunchmenu = SourcePage.contentDocument.getElementById("LeftNavigationAreaCell") ;}
   else if(SourcePage.contentWindow)
      // Internet Explorer
      {quicklaunchmenu = SourcePage.contentWindow.document.getElementById("LeftNavigationAreaCell") ;}
   else if(SourcePage.document)
      // Others?
      {quicklaunchmenu = SourcePage.document.getElementById("LeftNavigationAreaCell") ;}
}
catch(err) { alert ("Loading failed");}
var allDescendants = quicklaunchmenu.getElementsByTagName("*");
for (i=0;i<allDescendants.length;i++) {
allDescendants[i].removeAttribute("id");
allDescendants[i].removeAttribute("onclick");
allDescendants[i].removeAttribute("onfocus");
allDescendants[i].removeAttribute("onmouseover");
}
placeholder.innerHTML = quicklaunchmenu.innerHTML;
}
</script>

No comments:

Post a Comment

Thanks for commenting, if you have a question and want a reply, please post it on TechNet forums and reference this blog, or navigate to www.SharePointPapa.com and post it there, all of these blog posts and more are on my SharePoint Papa site.

Popular Posts