Thursday, October 10, 2013

Remove Recently Modified from Quick Launch

If you are working in SharePoint 2010, you may find that your quick launch creates a section called 'Recently Modified'. This section is great for showing what recently changed on the site. However, it is not always needed. 

To remove this section from the quick launch:

  1. Add a Content Editor Web Part (CEWP) to the page 
  2. Edit the web part's source code 
  3.  Add the following code:  

      <style>
      .s4-recentchanges{
       display:none;
      }
      </style>

The recently modified section will be removed. 

Source: http://thechriskent.com/2012/07/05/hiding-the-recently-modified-section-in-sharepoint-2010/



Friday, September 27, 2013

How to Hide the Edit Tab in a Ribbon

In SharePoint 2010, add the following code to a CEWP.



<script type="text/javascript">// <![CDATA[
function ResetRibbon() {
try {
var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();
SelectRibbonTab("Ribbon.Read", true);
ribbon.removeChild('Ribbon.ListForm.Display');
ribbon.removeChild('Ribbon.ListForm.Edit');
} catch (e)
{ }
}
SP.SOD.executeOrDelayUntilScriptLoaded(function () {
try
{
var pm = SP.Ribbon.PageManager.get_instance();
pm.add_ribbonInited(function () {
ResetRibbon();
});
var ribbon = null;
try {
ribbon = pm.get_ribbon();
}
catch (e) { }
if (!ribbon) {
if (typeof (_ribbonStartInit) == "function")
_ribbonStartInit(_ribbon.initialTabId, false, null);
}
else {
ResetRibbon();
}
},
"sp.ribbon.js");
}catch(e)
{}
// ]]></script>
<script type="text/javascript">
function ResetRibbon() {
try {
var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();
SelectRibbonTab("Ribbon.Read", true);
ribbon.removeChild("Ribbon.ListForm.Display");
ribbon.removeChild("Ribbon.ListForm.Edit");
} catch (e)
{ }
}
SP.SOD.executeOrDelayUntilScriptLoaded(function () {
try {
var pm = SP.Ribbon.PageManager.get_instance();
pm.add_ribbonInited(function () {
ResetRibbon();
});
var ribbon = null;
try {
ribbon = pm.get_ribbon();
}
catch (e) { }
if (!ribbon) {
if (typeof (_ribbonStartInit) == "function")
_ribbonStartInit(_ribbon.initialTabId, false, null);
}
else {
ResetRibbon();
}
} catch (e)
{ }
}, "sp.ribbon.js");
</script>

and the tab will disappear :) 

Source: http://sharepoint247.wordpress.com/2013/05/24/javascript-to-hide-or-select-specific-tabs-in-sharepoint-ribbon/




Remove Content Approval Message from Forms.


Whenever a SharePoint list requires content approval for submitted items, you will find the following message on  your new item forms:

"'Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights.'"

I find this message very confusing to my users so I often remove it. 

To remove the message,

  1. Go to 'List settings' and then 'Advanced settings'
  2. Scroll down to 'Dialogs' 
  3. Select 'No' under 'Launch forms in a dialog?' then select 'OK'
  4. Go back to your list and select 'Add new item'. Your new item form will open as a page.
  5. Go to 'Site Actions ' and select 'Edit Page'
  6. Add a CEWP (Content Editor Web Part)
  7. Edit the web part's html source code 
  8. Enter the following CSS: 

<style>
.ms-informationbar{visibility:hidden;}</style>

    10. Click save 

The message will be removed from the form. 

If you want your forms to open as dialogues again, simply follow steps 1-3. However, in step 3 select 'Yes' instead.






Friday, August 30, 2013

Show only the time in your sharepoint column

I hate that SharePoint does not provide a time only column. So, what should one do if they have a form in which their users need to record the time only?

In my example, I had to use a time/date column, called "Departure time" in which users needed to provide the time in which they departed  a location. However, I did not need a date.

Problem:
In InfoPath, I could delete the date portion of the form and leave only the time field. However, when I went to  the list view I would still see a date with their recorded time proceeding.


To get around this I used the steps below:
  1. Created a calculated column called 'Recorded Departure Time'
  2. Inserted the following formula: =Text (Departure Time,"HH:MM:SS")
  3. Edited my view to only show only my 'Recorded Departure Time' and hide my original 'Departure time'
Please Note: This method will show in military time. However, if you don't mind military time; this is a great solution.

Source: http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8035f07-8320-48b5-98d7-f48dde2eaf2f/sharepoint-2010-insert-only-time-in-list-column

Change Link - "Add new item"

At the bottom of your sharepoint list, there is usually a link that say's "Add new item". This link bascially allows users to create new items in a list. However, what if you wanted it to say something different? In my case, I had a contact list and wanted it to say "Add new contact".

Using the steps below, I was able to sucessfully do so.

  1. Add a Content Editor webpart to the view you would like the link changed on. Please note: if you have more then one view for this list, you will need to repat these steps for each view.
  2. Add the javascript below, replacing "your message here" with the message prefer:

<script> document.getElementById("idHomePageNewItem").innerHTML="Your message here"</script>


  
  Source: http://dishasharepointworld.blogspot.com/2011/08/sharepoint-2010-change-add-new-item-and.html

Tuesday, July 2, 2013

Create Calculated Columns Using [Me] or [Today]

As many may know, when creating custom list fields,  SharePoint does not allow you to use  [Me] or [Today] in a calculated field type. 

Here's a workaround, using [Me] as the example. However, you can also use these same steps for [Today] also. 

  1. In your list, create a "single line of text" field titled Me
  2. Now create a "calculated" field titled CalcMe with the following formula =[Me]
  3. Now go back and delete the first text field you created titled Me
By doing this you trick SharePoint into using the Me field. Hope this helps :) 


Tuesday, June 11, 2013

Adding Javascript to a Quick Launch or Top Link Bar

If you ever tried adding javascript to the Quick Launch or Top Link Bar you'll find it's impossible to do so using the setting page under navigation.

Here's another alternative:

1. Enter one of the following URL's into the address bar (this depends on which of the two you want to edit).  

Quick Launch: http://<site address>/_layouts/quiklnch.aspx  
Top Link Bar: http://<site address>/_layouts/topnav.aspx

2. Enter your javascript within the web address bar and the link title within the description. 



Removing the time from your SharePoint Calendar

Recently, I created a calendar but did not want the out-of-the-box time stamp (12:00) to show by each of my calendar's entries.

Here's what I found to remove this:
  1. Add a content editor webpart to your page 
  2. Enter the following code:
     <style>
.ms-acal-item {
BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
}
.ms-acal-time {
DISPLAY: none
}
.ms-acal-sdiv {
MARGIN-LEFT: -58px
}
.ms-acal-sdiv A {
POSITION: absolute; WIDTH: 100%; LEFT: 0px
}
.ms-acal-title {
HEIGHT: 35px; PADDING-TOP: 0px
}
< /style>


Voila! The timestamp is gone.

Source: http://happysharepointing.blogspot.com/2011/10/removing-default-time-from-sharepoint.html


Wednesday, May 8, 2013

Convert a 2007 SharePoint template to 2010



The other day I had to migrate a few SharePoint 2007 lists to a 2010 site. However, when I tried to do so, I received a message stating that my templates were not supported. Luckily, I found a fix.

Hopefully, this can help others. 
  1. Download the 2007 list template to a local folder
  2. Rename the .STP to .CAB
  3. Open the .CAB 
  4. Extract the .CABs manifest.xml to a local folder
  5. Open the xml in Notepad
  6. Search for  ProductVersion. This it will be 3
  7. Change it to 4
  8. Save your change.
  9. Now Repackage the manifest.xml into your .CAB
    • This can be done by going to your Start menu and selecting Run
    • Enter cmd
    • Then entering the following Syntax: makecab.exe {folder}\manifest.xml {folder}\{template-name}.cab Example: makecab H:\myfolder\manifest.xml H:\myfolder\2007template.cab
  10. If you donot receive a error message go back into the folder where the .CAB is saved.
  11. Open the folder and review the manifest to make sure the Product version 4 has saved within the xml.
  12. If correct, close the file and change the cabinet's extension from .CAB back to .STP
  13. Upload it into your SharePoint 2010 list template library. 
Now it should work.



SharePoint Export to Excel via a Link

I recently had a client that did not want to use the "out of the box"  export to Excel feature in SharePoint.  Instead, they desired a link that could be added anywhere on a page, capable of also providing this functionality.


Step 1:

First, I had to find the guid of  the list and view that they wanted to export to Excel. To do this, I went to their SharePoint site's specific list and view, selected modify this view, and then copied the url from the "edit view" page.

Step 2:

I  pasted the url into Notepad and removed everything except  for the list and view guid (highlighted in yellow below). http://Mysharepointsite/examplesubsite/_layouts/ViewEdit.aspx?List=18c5120f%2Db6be%2D4836%2Dbc6c%2D88d3a7e42aa8&View=%7B5C4DB341%2D0AFA%2D460E%2D9FA4%2D0383CC723FF2%7D

Step 3:

I added a content editor web part (CEWP)on the page they desired their link. 

Step 4:

Finally, I edited the content editor's HTML source and entered the following:

<a href="http://Mysharepointsite/examplesubsite/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=18c5120f%2Db6be%2D4836%2Dbc6c%2D88d3a7e42aa8&View=%7B5C4DB341%2D0AFA%2D460E%2D9FA4%2D0383CC723FF2%7D&CacheControl=1">Export Report to Excel</a>

Here is a another example:

Just replace the yellow highlighted areas with your site's information

<a href="http://yoursiteurl/yoursubsite/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[listguid]View=[viewguid]&CacheControl=1">Export Report to Excel</a>

Please note, I have found that users must have Microsoft Excel 2007 or later for this to work to export. They must also use Internet Explorer or Firefox as their web browser.


My source: http://weblogs.asp.net/wkriebel/archive/2005/08/22/LinkToExportToSpreadsheet.aspx





Changing a SharePoint list url

I hate to see % signs  in a  url and to prevent this, I try to create my urls without spacing. Doing so not only provides a clean address but also a quick and easy way for me to remember them.

However, what do I do if I accidently use spaces and end up with a list url containing % signs? 

If I have been granted "full control" to the site, I open Sharepoint Designer!

  1. Once in Designer, open the site that the url belongs to 
  2.  Select "All files" located within the left hand of Designer, under "site objects"
  3. Select the  "lists" folder
  4. Right click the list that I would like to change
  5. Select "rename"
  6. Type the new name and press enter