Hide the Quick launch without modifying the master page

Sometimes you may want to hide the Quick launch on a page quickly without creating a new masterpage just for that page. Luckily you can do this with CSS. All you have to do is add a content editor web part to the page in question, and then either paste the blow code into the HTML editor or reference a .txt document with the code in the content editor web part. Then hide the content editor web part by choosing “None” in Chrome type under appearance on the edit web part settings. Here is the code: <style> #s4-leftpanel { DISPLAY: none } #MSO_ContentTable { MARGIN-LEFT: 0px }</style>

Advertisements

How to open a link in an AJAX popup window

Sometimes you may want to open a new item/page in a popup window but without the risk of a popup blocker blocking it. In SharePoint this is where an Ajax popup box comes in extremely useful.

I tend to use this when I want to keep users on one page but use a lot of libraries and lists.

There are many ways you can use the code, the most obvious are;

  • pasted straight into the code of the ASP/Master page
  • add a content editor web part into the page, then paste the code into the HTML editor
  • save the code as a .txt document and then reference that .txt document in the content editor web part.

I usually use the latter, this way if you ever need to edit the code to add or remove items you can just open the document from the document library edit the file then click save and everything updates. (I usually create a document library called “Branding” then i put all of my .txt code files and images in this library and set the library permissions to read for all authenticated users)

So without further ado here is the code, this is the code for a document library upload box but it will also work for a list new item or to view a list/library; (the parts which you need to edit are in bold)

<a onclick=”javascript:NewItem2(event, &quot;http://PASTE YOUR URL IN HERE/&quot;); javascript:return false;” href=”http://PASTE URL IN AGAIN HERE/>img alt=”IMAGE DESCRIPTION TEXT” src=”http://PASTE URL OF IMAGE TO USE AS CLICKABLE LINK HERE“/></a>

Here is a complete example;

<a onclick=”javascript:NewItem2(event, &quot;https://www.mysharepointdoclibrary.com/_layouts/Upload.aspx?List={01ABD049-5A4A-452E-9C99-260B26358AEE}&RootFolder=&quot;); javascript:return false;” href=”https://www.mysharepointdoclibrary.com/_layouts/Upload.aspx?List={01ABD049-5A4A-452E-9C99-260B26358AEE}&RootFolder=”><img alt=”Image of Upload Document” src=”https://www.mysharepointdoclibrary.com/imageslibrary/App-Upload.gif”/></a&gt;