Showing posts with label People Search. Show all posts
Showing posts with label People Search. Show all posts

10 August, 2012

People Picker control gets spell checked on a custom layout page: SharePoint 2010


Happy Friday to all of you :)

People Picker is configured at the zone level for a farm by using the Stsadm setproperty operation. By configuring the settings for the control, you can filter and restrict the results that are displayed when a user searches for a user, group, or claim. Those settings will apply to every site within the site collection.

Problem Description:
While editing a custom layout page that contains a people picker control, you spell check the page. The spell check returns a large number of errors on the people picker control.

Probable Causes:
During the page editing process, SharePoint looks for text that are spell checking candidates. The text is included unless the control is explicitly marked for exclusion by a non-public attribute or by having its class set to 'ms-spellcheck-false'.
The people picker control fails both tests and its text, in xml format, is included in the spelling chunks.

Resolution:
Add a small custom code to override the above behavior and exclude the control from the spell checking. Follow the steps listed below:
1.   Launch SharePoint Designer and from the File Menu, choose Sites.

2.   Open your site and from the site objects menu on the left, select Page Layouts.

3.   From the list of page layouts on the right panel, right click on the page with the issue (the one containing the people picker control) and select “Edit File in Advanced Mode”.  

Note: If the page is not checked-out, you will get a prompt for it. Click ‘Yes' for it.
For the next steps, refer to the following code example:
  
Step 1

On the HTML that defines the control, add an ID property if one does not exist already. You will need this ID for the next step. Your page should resemble something like this:
<table>
    <tr>
        <td>
            Contact:<SharePointWebControls:UserField FieldName="Publishing Contact" runat="server" ID="PeoplePicker1">
        </td>
    </tr>
</table>
Step 2

before the last statement on the page (the </asp: Content> tag), add the following script:
 <script type="text/javascript">
_spBodyOnLoadFunctionNames.push("OverrideSpelling");

function OverrideSpelling(){ 
   var $fld_in = document.getElementsByTagName('input'); 
   var $fld_tx = document.getElementsByTagName('textarea'); 
   for( $i = 0; $i < $fld_in.length; $i ++ ) {
      var $inputName = $fld_in[$i].getAttribute('name');   
      if($inputName.indexOf('PeoplePicker1') != -1) {
         $fld_in[$i].className = 'ms-spellcheck-false';   
      }
   }

   for( $i = 0; $i < $fld_tx.length; $i ++ ) {
      var $inputName = $fld_tx[$i].getAttribute('name');   
      if($inputName.indexOf('PeoplePicker1') != -1) {
         $fld_tx[$i].setAttribute("excludeFromSpellCheck","true");   
      }
   }
}
</script>
1.   Note the bold value on the function argument. You will need to use the same ID that was used on the control declaration.
2.  
Save the page and try the spell check now.

3.   The page should now exclude the people picker control from the spell check.

If you have any queries/questions regarding the above mentioned information then please let me know. I would be more than happy to help you as well as resolves your issues :) Happy SharePoint to all of you :)

26 March, 2009

People search not working in MOSS 2007 Server

Setting up Search functionality in SharePoint server site, which needs configuration of Shared Services Provider (SSP)
1)   Setting up user Profiles
2)   Setting up address to be crawled
3)   Set up of Scope

After the complete configuration, you might come across situation where search in site data works but people search doesn’t seem to work.

This can really very frustrated… Well though it seems like a big issue with installation and stuff but it’s a “miss” in configuration setting.

The addition of url “sps3://sitename “works wonders…..

I hope, this will help and resolves all your problems. Please let me know in case of any queries, Thank you.