Posted on May 5, 2010.
Search Results by Yerpilev Sveta - Sharepoint Consultant, Professional Services Kwizcom One of my clients once asked me to change the look and feel of their search results page. The client is a large company that decided to change the design of their SharePoint portal. The portal has a research center that was where I needed to change.
So I did it:
First I had one of the key outcomes of Web Parts. You can add a Web Part to the results page of the Web Part Gallery or use the SharePoint Web Part that is automatically added to each page of search results.
Then I had to set up the fields (columns) that I wanted to see in the search results. To do this - open the properties of basic Web results and query results change the options selected columns XML text. To add a new column that you must add this text to the front xml </ tag> Columns:
<Column Name="YourColumnName"/>
Save the changes and now you can begin to redesign the look and feel of the search results. The fastest way to do this is to use the XML search results. To access the XML data, you must add this code instead of XSLT Web Part XSL Editor:
<? Xml version = "1.0" encoding = "UTF-8"?>
Version <xsl: stylesheet = "1.0"
xmlns: xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="*"/>
> </ XSL: template
</ XSL: stylesheet>
Save your changes and do a test search. You will get an XML search results. Copy this code and paste it in notepad. Save the file to your desktop and open SharePoint Designer. Log in to one of your SharePoint sites and create a new blank ASPX page. After that, go to the Design of your page and add a new DataView Web Part. In the details of selecting the data source XML files and add a new XML file. In the window that opens navigate to the file that you saved before and import it into SharePoint Designer.
Once you do this, you will see your file in the XML files section. Click on the file and press "View Data".
Now you can design your Data View Web Part as you want, using columns of search results from XML file. You'll also be able to do the sorting / filtering / grouping on your search results, but keep in mind that each function will create the results on the page you are currently using. In other words, if you sort your search results by site title of the grouping will group the contents page of your current search results.
When you're finished designing your page, you the only thing you need to do is copy the entire code of your page between the tags and <XSL> </ xsl> and paste it in the XSL editor results of component-based Web. Save your changes and verify that everything is working by testing research. If you like the look of your results page, you can delete the temp ASPX page of your SharePoint site and delete the search results XML file.
If you want more information about customizing a page of search results, I propose this perceptive article by Tobias Zimmergren:
http://www.zimmergren.net/archive/2008/03/15/moss-2007-customize-the-search-result-using-xslt-part-3-customize-using-sharepoint-designer-2007.aspx
SharePoint gives you many options to customize your search results.
You can set different pages of search results for each search art