- Open your web browser and navigate to the page that contains the current People Search Box web part
- Select Site Actions -> Edit Page
- Click on your web part's menu and select Edit Web Part
- Expand Display Properties and click on the XSL Editor... button
- In the Text Editor window, copy the existing XSL to a temporary location since you'll probably need it again. Here is a possible option for you:
- Hit Ctrl+a to highlight all of the content
- Hit Ctrl+c to save the content
- Open Notepad
- Hit Ctrl+v to past the content to Notepad
- Return to the Text Editor window, hit Ctrl+a, and hit Delete
- Copy and paste the HTML and Javascript code below into the Text Editor window:
- Click Save
- Click OK
- Publish the page
If the new web part works as expected, you can then hide the original People Search Box web part and you're done! With that being said, here is the code you will need to copy for Step #7...
<div> <table border="0" ID="WildcardPeopleSearchTable" width="500px"> <tr > <td class="ms-sbcell" align="left" style="width: 450px" > <input id="txtSearchParameter" name="txtSearchParameter" type="text" onkeypress="pressEnter()" onFocus="this.select();" class="ms-sbplain peopleInput" style="width: 100%"/> </td> <td class="ms-sbgo ms-sbcell"> <img id="btnSearch" alt="Search" onmouseover="mouseOverImage();" onmouseout="mouseOutImage();" src="/_layouts/images/gosearch30.png" onkeydown="if (event && event.keyCode==13) search();" onclick="search()" style="border-width:0px;" /> </td> </tr> </table> </div> <script language="javascript" type="text/javascript"> document.getElementById("txtSearchParameter").focus(); function mouseOverImage() { document.getElementById("btnSearch").src = "/_layouts/images/gosearchhover30.png"; } function mouseOutImage() { document.getElementById("btnSearch").src = "/_layouts/images/gosearch30.png"; } function pressEnter() { if (window.navigate) { if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { search(); } } } function search() { var resultsUrl = getSearchUrl(); var space var searchParameter = document.getElementById("txtSearchParameter").value; resultsUrl = resultsUrl + "?k=" if (searchParameter != "") { resultsUrl = resultsUrl + searchParameter + "*"; } window.location.replace(resultsUrl) } function getSearchUrl() { var searchUrl; searchUrl = window.location.protocol + '//' + window.location.hostname + '/search/Pages/peopleresults.aspx'; return searchUrl; } </script>
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.