Sep 14
8
A user posted a List View Web Part on their intranet site alongside their Announcements (also a List View Web Part). For a cleaner look, I was asked if we could get rid of the column headers for all of the web parts on the page. They aren’t really useful, they state the obvious, and they take up valuable real estate on the site. So let’s get rid of them.
*** Click the images to view them full-size ***
It took a little while via Google to find the solution which was:
A.) not selected as an answer, and
B.) all the way at the bottom.
So I’ll make it quick and easy for you.
<style> .ms-viewheadertr { display: none;} </style>
Success! Now all of the List View web parts on the page will render without the unnecessary column headers.
If you have seen either of the above messages while trying to open a document in SharePoint, you are probably as confused as we were. My user was getting this even though the file was not checked out. Worse still, the message said that the file was locked out… by him. He didn’t have it open and there were no “orphaned” processes of Winword.exe running in Task Manager. So how could this be?
When I Googled this error, I came upon a ridiculously weak thread on TechNet that basically says it’s designed that way and that you have to wait for 10 minutes for the lock to clear. Nonsense!
The culprit in our case was Credential Manager, which may be accessed via Control Panel. Simply select the entry for the web application URL in Credential Manager and delete it by selecting “remove from vault“.
For step-by-step instructions on how to do this (including screenshots), follow the post Step 2: Clear Your Cache in Credential Manager from a few months back.
First, an introduction to the Productivity Hub for SharePoint 2010:
Microsoft has developed the Productivity Hub to help support your ongoing end user training efforts.
The Hub is a SharePoint Server site collection that serves as a learning community and is fully customizable. It provides a central place for your training efforts, and includes training content from Microsoft’s core products.
The Problem
On the main page there is a nifty Slider Silverlight Web Part that allows users to scroll through preview thumbnails of the various videos available. It’s very cool. There’s also a slider on the Videos page. We had the problem recently where the slider on the Videos page was not rendering the preview thumbnails, as seen in the screenshot below.
Clicking the failing-to-load image did correctly launch the appropriate video so that functionality was fine – it was simply that the thumbnails were not showing. They are located in Site Assets / Video Thumbnails folder.
You can find the files listed below. They are named in such a way that it is easy to identify which file is used as a thumbnail for which video.
Video Thumb-Excel.jpg
Video Thumb-InfoPath.jpg
Video Thumb-OneNote.jpg
Video Thumb-Outlook.jpg
Video Thumb-PowerPoint.jpg
Video Thumb-Word.jpg
For these files to not show there are two possible scenarios:
those files are either missing -or- they are corrupt.
In our case they were corrupt. We came to this conclusion because we were not able to download these image files. ( It was throwing a download error stating that the file was corrupt).
The Solution
How these files became corrupt is a mystery. As you might be aware SharePoint does not give the user the privilege to edit image files directly, so we’ll just have to replace them.
First, we have to go get the image files. Open the following site in your browser http://www.spsdemo.com/sites/productivity/. Get the images from here.
Then, simply upload and overwrite the corrupt images -or- delete the old corrupt images from the library and then replace them with the good ones.
Either way: problem solved.
What would it be like if you had power in your hands but still were not able to use it… Yes it happens almost every day in the lives of us SharePoint People. Today we are going to talk about one such situation: the people picker control. You cannot set a default value for the people picker control from the SharePoint UI… wonder why? With a little help from JQuery, we can.
So we are going to make this happen. Lets Start. Create a custom list and add new columns of your choice. One of them should be a people picker control. Here I have given the title of the people picker control to be “Assigned To“. Now there are two ways to implement this functionality. Either open the Newform.aspx in SharePoint Designer, (not a very recommended approach but if you want a quicky, then do this by writing JavaScript and JQuery anywhere below the Content PlaceHolderMain) else open the Newform.aspx page in the browser and insert a content editor web part. Now create a text file and write the JavaScript and JQuery inside this text file, save it as .txt file and upload this to some location in the SharePoint site where you want this functionality to be implemented.
In the content link property of the content editor web part, provide the URL of the location of the text file that we previously created. Please find the code below for this file. These three files need to be loaded onto the server where this code is getting called. ( Please download them from the internet.)
Please find the code below written in JQuery/Javascript. This is the code that needs to be placed for achieving the functionality:
<
<script src="http://yourserver/sites/ListBreak/SiteAssets/jquery-1.10.2.min.js"></script> <script src="http://yourserver/sites/ListBreak/SiteAssets/jquery.SPServices-0.7.2.min.js"></script> <script src="http://yourserver/sites/ListBreak/SiteAssets/jquery.SPServices-0.7.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ //Get the current user var user= $().SPServices.SPGetCurrentUser(); // This is for getting current user var defaultuser = "Guru ,Venkataraman"; // this is for assigning any default user to the control //Set all sharepoint 2010 people picker default to current user $("div[title='People Picker']").text(defaultuser); }); </script>;
Once this is added in the appropriate place with the supportive .js files, you should see the below screen for the newform.aspx on your list with the people picker control populated with a default username.
HAPPY CODING!!! 🙂
Guru
Today we are going to talk about a piece of functionality that would make you feel….Oh i have to have it!. I am talking about the “Email a Link” functionality for an individual list item.
You may think this is already available so what’s the commotion all about? Yes!! This functionality is available in SharePoint document libraries but not for lists. Furthermore, you cannot add this OOTB or as a feature or add-on. It’s just not available. No idea why Microsoft did such a thing. The fundamental principal behind the solution presented here is to exploit the OOTB control that is provided for libraries to a custom list using a little tweak.
This custom Email a Link functionality is implemented for custom lists to have the ability to send a link of that item in an Email client. The use of the ribbon, the power of the JavaScript call to window.open, and the mailto parameters makes the magic come together.
Still confusing? Let’s dive in to the well to find out more.
So let’s start getting our hands dirty by starting with our Visual Studio Custom Ribbon Project. Select your Visual Studio tool to be run as Administrator. Select New project from File menu. You will land in the screen as shown below.
Select an empty SharePoint project. Currently I use C# as my preferred language of instruction.
When you click on the OK button, VS takes you to the config screen as shown below where you select this solution to be a farm solution. We are doing this because this can be globally reused at any site collection.
Click on the Finish button and you should have a SharePoint project created. Please use the name of the project as per your requirement. Now once added, right click on the project and select add new item. In the below screen that is seen, select empty element. Name it appropriately, this is more of an .xml file that is going to do the trick for us.
Open the empty xml file and paste the following code given below: modify a few parameters to suit your requirement.
<br /> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"><br /> <CustomAction<br /> Description="EFH Email A Link"<br /> Title="EFH Email A Link"<br /> Id="{DB6F9FD7-2E67-44a2-9E7D-BE071FBEF309}"<br /> Location="CommandUI.Ribbon"<br /> RegistrationId="100"<br /> RegistrationType="List"<br /> Sequence="1"</strong></em><br /> Rights="ViewListItems"<br /> xmlns="http://schemas.microsoft.com/sharepoint/"><br /> <CommandUIExtensionxmlns="http://schemas.microsoft.com/sharepoint/"><br /> <!-- Define the (UI) button to be used for this custom action --><br /> <CommandUIDefinitions><br /> <CommandUIDefinitionLocation="Ribbon.ListForm.Display.Manage.Controls._children"><br /> <ButtonId="{B4D644C1-B0DE-4856-9F6A-380B47C05D15}"<br /> Command="{AAA6F08B-F53E-4799-BA2F-8D89F0E7AC01}"<br /> Image16by16="/_layouts/1033/images/formatmap16x16.png"<br /> Image16by16Top="-16"<br /> Image16by16Left="-88"<br /> Sequence="1"<br /> LabelText="EFH Email A Link"<br /> Description="EFH Email A Link"<br /> TemplateAlias="o2" /><br /> </CommandUIDefinition><br /> </CommandUIDefinitions><br /> <CommandUIHandlers><br /> <!-- Define the action expected on the button click --><br /> <CommandUIHandlerCommand="{AAA6F08B-F53E-4799-BA2F-8D89F0E7AC01}"<br /> CommandAction="javascript:CustomEmailaLink('{ItemId}','{SiteUrl}','{ItemUrl}');<br /> function <strong><em>CustomEmailaLink</em></strong>(ItemId,SiteUrl,ItemUrl)<br /> var linkValue = encodeURIComponent(window.location.href);<br /> var items = SP.ListOperation.Selection.getSelectedItems();<br /> window.open('mailto:?subject=This Item Needs your attention'+'&amp;body='+ linkValue);<br /> }"/><br /> </CommandUIHandlers><br /> </CommandUIExtension><br /> </CustomAction><br /> </Elements><br />
You screen should look like this
Now for a little explanation :
The main tag would be the <CustomAction which would have
Description=”EFH Email A Link” == Refering to what your ribbon control is all about
Title=”EFH Email A Link” == the title of the ribbon control
Id=”{DB6F9FD7-2E67-44a2-9309}” == unique guid, generated byGUID tool in VS
RegistrationType=”List” == for what type of component would this be used.we specify this explicitely as list
<CommandUIDefinitionLocation=
“Ribbon.ListForm.Display.Manage.Controls._children”>
this is the control inherited from which this ribbon button already exists ( remember i said we need to exploit the existing button from the library email a link functionality.
Image16by16=”/_layouts/1033/images/formatmap16x16.png”
Let this remain as it is as we are using the existing image. in case you want a different image, please create a 16 X 16 pixel sized image and put it into the layouts / 1033 / images location
Image16by16Top=”-16″ = = this attribute would not be valid if you are using a custom image
Image16by16Left=”-88″ = = this attribute would not be valid if you are using a custom image
LabelText=”EFH Email A Link” == the text that would be displayed
this is the main section where we have given our own custom JavaScript function.
CommandAction=”javascript:CustomEmailaLink(‘{ItemId}’,'{SiteUrl}’,'{ItemUrl}’);
function CustomEmailaLink(ItemId,SiteUrl,ItemUrl) {
var linkValue = encodeURIComponent(window.location.href);
var items = SP.ListOperation.Selection.getSelectedItems();
window.open(‘mailto:?subject=This Item Needs your attention’+’&body=’+ linkValue);
What this function does is that it takes in three input parameters like the ID of the individual list item, the url of the site and the url of the individual item and sends it as parameters to the mailto inbuilt function java script function.
Now finally : Run the build, and deploy the solution. Activate the feature and you should be able to see the ribbon control for the library where this function was meant to be as shown below.
“Email a Link ribbon button
This ribbon button invokes the default email client and pre-loads the current item link to the body of the email. If a default email client is not available, then it prompts the user to configure a default email client.
Happy Coding 🙂 !!!!!!!!!
Guru
Several of my users have encountered the problem of three failed login attempts to SharePoint resulting in a blank white screen. This can happen when a user’s login credentials (username and password) are incorrect. Unfortunately, this can also happen when they put in their correct information. This second scenario can be bedeviling so I’ll go over the various tasks you can perform to resolve this problem:
1. Clear your browser cache and restart your browser
2. Clear your cache in Credential Manager
3. Alternate way to clear your cached credentials
4. Add site to Trusted Sites
5. Pass along current credentials to IE
**Please also note the addendum regarding prompts for a mapped drive to a SharePoint site.
Perhaps the easiest and most well known, you’ve probably already tried this step. If you have not, Google the steps and perform them, then restart IE.
Alternatively, if you have WinXP you will not have Credential Manager – you will have Stored Usernames and Passwords instead. This site will guide you on how to clear this system cache in WinXP.
Source: Windows IT Pro website
Internet Explorer lets you categorize websites into different zones with different security policies for each zone. Be default, sites are all categorized as Internet. We will look at two different types of site: Intranet and Trusted Site.
If you are on a company Intranet site you should add the url to your list of sites in your Intranet zone.
If you are experiencing trouble authenticating to an Internet site that you regularly visit (and that you trust) you should add it to your Trusted Sites zone.
You’ll want to configure Internet Explorer for automatic logon with current user name and password as above. However, you’ll also need to edit your registry to tell Windows to allow the webclient service to remember passwords.
Source: http://tipsyouforgot.blogspot.com/2010/06/remember-password-setting-not-working.html
Apr 14
1
Recently, we needed to redirect users from a site in SharePoint to another site. First, we set the old site to Read-Only. How? Navigate to {Central Administration Site |Application Management | Configure Quotas and Locks} and select one of the options under “Site Lock Information“.
We then copied all of the content, and sent out a message to the users affected about the new site location. For those who did not get the e-mail, we wanted to redirect traffic to the new site along with an explanatory message. We went with “the simple way” below but if you feel like showing off, go with the second option.
This tutorial by Devin Walker fits the bill. It uses the JavaScript Alert box which provides for a message and an OK button. We chose to use a Confirm box instead in order to allow a choice for users to either stay on the Read-Only site or go to the new site.
Here is the code we used:
<script type=”text/javascript”>// <![CDATA[ var cnf=confirm("XYZ site has been migrated, and this site is now Read-only. \n\nClick Ok to navigate to the new, migrated site or Cancel to remain on this Read-only site."); if(cnf) { location.href="http://sharepointserver/sites/XYZ/"; } // ]]></script>
To Implement
Use a Content Editor Web Part (CEWP) and paste in the above code, modified with your message and your new site url in the location.href statement. That’s it.
The above provides a simple, old school (some would say “archaic”) redirect script and message. If you’re like me, sometimes you like to be fancy and modern. In this case, implement this nifty script instead to alert users and redirect them to the appropriate sites.
To Implement
Download the zip file from the website, unzip the files, and upload them to your Site Assets document library (or a folder there created for this purpose).
Then, install a Content Editor Web Part (CEWP) on the target page and proceed as above, edited for your environment and the path to your Site Assets document library.
Today I implemented an Issue Tracking list in SharePoint 2010 for a project. As the users started using it, I noticed that the Title column was narrow, hence the longer titles were wrapping to several lines. This does not look good at all.
So I went to Google and set out to modify the column width of my list. I found this post by someone named Aanu but was disappointed that it didn’t work. As is often the case, I read further down into the comments and found a gem from a user named George: we needed to add one more parameter to the style information. Now it works just fine. Here is the process in one neat, concise explanation.
Open the site in SharePoint Designer 2010, then navigate to Lists and Libraries, then select the desired list. In my case it was Issues.
Select the List, then select the desired view. In my case it is “All Issues”. Views are located in the upper right.
Now select the column you want to edit. Follow Aanu’s post about editing both the <th> and <td> sections by performing these three actions:
Now, follow George’s suggestion to perform a fourth action:
4. Add a parameter for min-width in the style code as well.
Your code should look like the below images.
**Click to open them full-size.**
Today a site owner wanted to create a document library on his site that had been migrated from MOSS 2007 to SharePoint 2010. He attempted to create the doc library several ways, none of which worked:
The problem turned out to be a Site Feature that was not activated. To resolve this issue, I went into Site Actions, Site Settings. Under Site Actions, select Manage site features.
Scroll down to Team Collaboration Lists and activate this feature.
You should now be able to add Lists and Document Libraries to your site.
Aug 13
26
I had a user who got married and submitted her name change to the company. Active Directory was properly updated. Her old last name (Smith) does not appear anywhere in her AD record and has been replaced with her new last name (Jones). We have SharePoint 2010 set to perform an AD sync every night. For some reason, in SharePoint her name continues to show the old last name (Smith).
Attempt to Resolve
We used PowerShell to determine where all she had privileges and it was in only two groups: Member of one group, Visitor in another. So we removed her account in SharePoint via PowerShell. Then, when I went to manually add her back to the two groups, I used the PeoplePicker to find her. She was there correctly (Jones). So I selected her, then Add, only to find her display name incorrectly rendering as Smith. Since AD is correct it has to be SharePoint caching this somewhere, I reasoned.
Solution
To make this quick, the user at this forum thread had the exact same problem. After much back and forth, this is the correct solution submitted by one Mayur Joshi:
Let’s do this, hit the below URL
http://{SiteCollectionURL}/_layouts/people.aspx?MembershipGroupId=0
Look for the user that has old name, select the checkbox, click on Actions -> Delete User From Site Collection.
Make sure to note the parameter of MembershipGroudId=0. (That’s a “zero”, by the way.)
Happily, this solution resolved the issue for us. Thank you Mayur… and Google.