Thursday, June 7, 2007

Change the search results display in SharePoint Server

1) Navigate to following path
Home => Search page => Site Actions => Edit Page => Search Core Results Web Part => Edit => Modify Shared Web Part => XSL Editor button => Text Entry -- Web Page Dialog

a) Replace all code with:










<?xml version="1.0" encoding="UTF-8"?>



<xsl:stylesheet version="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="/">



<xmp>



<xsl:copy-of select="*"/>



</xmp>



</xsl:template>



</xsl:stylesheet>














b) Press Save
c) Click OK
d) Publish page

2) Now view the Search Core Results web part, it displays some xml. Copy that xml in a file and save it as results.xml for future use.






<All_Results>



<Result>



<id>1</id>



<workid>330</workid>



<rank>867</rank>



<title>Converting Office Word and Office Excel Forms to Office InfoPath.doc</title>



<author>Avinash A</author>



<size>358400</size>



<url>http://ServerName/personal/avinash_a/Shared Documents/Converting Office Word and Office Excel Forms to Office InfoPath.doc</url>



<urlEncoded>http%3A%2F%2FServerName%2Fpersonal%2Favinash%5Fa%2FShared%20Documents%2FConverting%20Office%20Word%20and%20Office%20Excel%20Forms%20to%20Office%20InfoPath%2Edoc</urlEncoded>



<description></description>



<write>5/31/2007</write>



<sitename>http://ServerName/personal/avinash_a</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>



Converting <c0>Office</c0> Word and <c0>Office</c0> Excel Forms to <c0>Office</c0> InfoPath



<ddd /> Converting <c0>Office</c0> Word and <c0>Office</c0> Excel Forms to <c0>Office</c0> InfoPath



<ddd /> Ways to convert an <c0>Office</c0> Word to <c0>Office</c0> Infopath-



</hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>



Converting <c0>Office</c0> Word and <c0>Office</c0> Excel Forms to <c0>Office</c0> InfoPath.doc



</HHTitle>



<HHUrl>



http://ServerName/personal/avinash_a/Shared Documents/Converting <c0>Office</c0> Word and <c0>Office</c0> Excel Forms to <c0>Office</c0> InfoPath.doc



</HHUrl>



</hithighlightedproperties>



<contentclass>STS_ListItem_DocumentLibrary</contentclass>



<isdocument>1</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/icdoc.gif</imageurl>



</Result>



<Result>



<id>2</id>



<workid>32</workid>



<rank>834</rank>



<title>Home</title>



<author>ServerName\Administrator</author>



<size>0</size>



<url>http://ServerName</url>



<urlEncoded>http%3A%2F%2FServerName</urlEncoded>



<description></description>



<write>6/2/2007</write>



<sitename>http://ServerName</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>



Welcome to Microsoft® <c0>Office</c0> SharePoint® Server 2007 <ddd /> Get started with the new version of Microsoft <c0>Office</c0> SharePoint Server 2007:



</hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>Home</HHTitle>



<HHUrl>http://ServerName</HHUrl>



</hithighlightedproperties>



<contentclass>STS_Site</contentclass>



<isdocument>0</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_Site16.gif</imageurl>



</Result>



<Result>



<id>3</id>



<workid>61</workid>



<rank>770</rank>



<title>Events</title>



<author>ServerName\Administrator</author>



<size>0</size>



<url>http://ServerName/Lists/Events/calendar.aspx</url>



<urlEncoded>http%3A%2F%2FServerName%2FLists%2FEvents%2Fcalendar%2Easpx</urlEncoded>



<description>Use the Events list to post information about meetings, deadlines, and other events related to this area.</description>



<write>5/30/2007</write>



<sitename>http://ServerName</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>



New <c0>Office</c0> Server!



</hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>Events</HHTitle>



<HHUrl>http://ServerName/Lists/Events/calendar.aspx</HHUrl>



</hithighlightedproperties>



<contentclass>STS_List_Events</contentclass>



<isdocument>0</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_List_Events16.gif</imageurl>



</Result>



<Result>



<id>4</id>



<workid>58</workid>



<rank>745</rank>



<title>Events - All Events</title>



<author>ServerName\Administrator</author>



<size>0</size>



<url>http://ServerName/Lists/Events/AllItems.aspx</url>



<urlEncoded>http%3A%2F%2FServerName%2FLists%2FEvents%2FAllItems%2Easpx</urlEncoded>



<description>Use the Events list to post information about meetings, deadlines, and other events related to this area.</description>



<write>5/30/2007</write>



<sitename>http://ServerName</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>



New <c0>Office</c0> Server!



</hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>Events - All Events</HHTitle>



<HHUrl>http://ServerName/Lists/Events/AllItems.aspx</HHUrl>



</hithighlightedproperties>



<contentclass>STS_List_Events</contentclass>



<isdocument>0</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_List_Events16.gif</imageurl>



</Result>



<Result>



<id>5</id>



<workid>366</workid>



<rank>739</rank>



<title>funding.docx</title>



<author>Chinmay Vartak</author>



<size>18060</size>



<url>http://ServerName/personal/chinmay_vartak/Proposals/funding.docx</url>



<urlEncoded>http%3A%2F%2FServerName%2Fpersonal%2Fchinmay%5Fvartak%2FProposals%2Ffunding%2Edocx</urlEncoded>



<description></description>



<write>5/31/2007</write>



<sitename>http://ServerName/personal/chinmay_vartak</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>Title funding Name Date </hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>funding.docx</HHTitle>



<HHUrl>http://ServerName/personal/chinmay_vartak/Proposals/funding.docx</HHUrl>



</hithighlightedproperties>



<contentclass>STS_ListItem_DocumentLibrary</contentclass>



<isdocument>1</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/icdocx.gif</imageurl>



</Result>



<Result>



<id>6</id>



<workid>368</workid>



<rank>739</rank>



<title>review.docx</title>



<author>Chinmay Vartak</author>



<size>18167</size>



<url>http://ServerName/personal/chinmay_vartak/Proposals/review.docx</url>



<urlEncoded>http%3A%2F%2FServerName%2Fpersonal%2Fchinmay%5Fvartak%2FProposals%2Freview%2Edocx</urlEncoded>



<description></description>



<write>5/31/2007</write>



<sitename>http://ServerName/personal/chinmay_vartak</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>Title review Name Last Modification Date </hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>review.docx</HHTitle>



<HHUrl>http://ServerName/personal/chinmay_vartak/Proposals/review.docx</HHUrl>



</hithighlightedproperties>



<contentclass>STS_ListItem_DocumentLibrary</contentclass>



<isdocument>1</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/icdocx.gif</imageurl>



</Result>



<Result>



<id>7</id>



<workid>436</workid>



<rank>739</rank>



<title>third.docx</title>



<author>Chinmay Vartak</author>



<size>18170</size>



<url>http://ServerName/personal/chinmay_vartak/Proposals/third.docx</url>



<urlEncoded>http%3A%2F%2FServerName%2Fpersonal%2Fchinmay%5Fvartak%2FProposals%2Fthird%2Edocx</urlEncoded>



<description></description>



<write>6/1/2007</write>



<sitename>http://ServerName/personal/chinmay_vartak</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>Title New review document Name Last Modification Date </hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>third.docx</HHTitle>



<HHUrl>http://ServerName/personal/chinmay_vartak/Proposals/third.docx</HHUrl>



</hithighlightedproperties>



<contentclass>STS_ListItem_DocumentLibrary</contentclass>



<isdocument>1</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/icdocx.gif</imageurl>



</Result>



<Result>



<id>8</id>



<workid>123</workid>



<rank>288</rank>



<title>New Office Server!</title>



<author>ServerName\Administrator</author>



<size>0</size>



<url>http://ServerName/Lists/Events/DispForm.aspx?ID=1</url>



<urlEncoded>http%3A%2F%2FServerName%2FLists%2FEvents%2FDispForm%2Easpx%3FID%3D1</urlEncoded>



<description></description>



<write>5/30/2007</write>



<sitename>http://ServerName</sitename>



<collapsingstatus>0</collapsingstatus>



<hithighlightedsummary>



New <c0>Office</c0> Server! <ddd /> New <c0>Office</c0> Server!



</hithighlightedsummary>



<hithighlightedproperties>



<HHTitle>



New <c0>Office</c0> Server!



</HHTitle>



<HHUrl>http://ServerName/Lists/Events/DispForm.aspx?ID=1</HHUrl>



</hithighlightedproperties>



<contentclass>STS_ListItem_Events</contentclass>



<isdocument>0</isdocument>



<picturethumbnailurl></picturethumbnailurl>



<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_ListItem16.gif</imageurl>



</Result>



</All_Results>





















3) Now Open SharePoint Designer and perform following actions:
File Menu => Open Site => Folder Name: "http://ServerName/SearchCenter/Pages/" (folder name will varies)

4) Select the msdnsearchresults.aspx from Folder List on left side of SharePoint designer and double click it to edit page layout.



5) In the newly opened SharePoint designer (i.e. Edit page layout of msdnsearchresults.aspx) open an aspx page.



Open Aspx page => Data View => Select - Managed Data Sources => Add an XML File => Browse to file => Press OK

results.xml file => Show Data => Result => Nodes => Select Title, author, write, imageURL => Drag-n-drop in designer

6) After drag-n-drop of nodes, following sections gets open




<body><form#form1><WebPartPages:DataFormatWebPart>








7) Perform following actions to change the stylesheet:

Column end => click arrow ">" => Common Data View Tasks => Change Layout => Select Layout => Press OK

Results value text => Click ">" => Common xsl:value-of Tasks => Format as: => Picture => Press Yes

Title value text => Click ">" => Common xsl:Value-of Tasks => Format as: => Hyperlink => Press Yes => Hyperlink dialog => Address: => {url} => Text to display: => {title} => Press OK

Write value text => Click ">" => Common xsl:value-of Tasks => Format as: => Date Time => Uncheck ShowTime => Select date format => Press OK

8) Change SharePoint designer in Split mode and Copy following node:
<xsl:stylesheet>... </xsl:stylesheet>






<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">



<xsl:output method="html" indent="no"/>



<xsl:decimal-format NaN=""/>



<xsl:param name="FileName" />



<xsl:param name="dvt_apos">'</xsl:param>







<xsl:variable name="dvt_1_automode">0</xsl:variable>



<xsl:template match="/">



<xsl:call-template name="dvt_1"/>



</xsl:template>



<xsl:template name="dvt_1">



<xsl:variable name="dvt_StyleName">2ColFrm</xsl:variable>



<xsl:variable name="Rows" select="/All_Results/Result" />



<table border="1" width="100%">



<tr>



<xsl:call-template name="dvt_1.body">



<xsl:with-param name="Rows" select="$Rows" />



</xsl:call-template>



</tr>



</table>



</xsl:template>



<xsl:template name="dvt_1.body">



<xsl:param name="Rows" />



<xsl:for-each select="$Rows">



<xsl:call-template name="dvt_1.rowview" />



</xsl:for-each>



</xsl:template>



<xsl:template name="dvt_1.rowview">



<td valign="top" width="50%">



<table border="0" cellspacing="0" width="100%">



<tr>



<td width="25%" class="ms-vb">



<b>Result:</b>



</td>



<td width="75%" class="ms-vb">



<img border="0" src="{imageurl/text()}" />



</td>



</tr>



<tr>



<td width="25%" class="ms-vb">



<b>title:</b>



</td>



<td width="75%" class="ms-vb">



<a href="{url}">



<xsl:value-of select="title" />



</a>



</td>



</tr>



<tr>



<td width="25%" class="ms-vb">



<b>author:</b>



</td>



<td width="75%" class="ms-vb">



<xsl:value-of select="author" />



</td>



</tr>



<tr>



<td width="25%" class="ms-vb">



<b>write:</b>



</td>



<td width="75%" class="ms-vb">



<xsl:value-of select="ddwrt:FormatDateTime(string(write) ,1033 ,'MM/dd/yyyy ')" />



</td>



</tr>



<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">



<tr>



<td colspan="99" class="ms-vb">



<span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view" />



</td>



</tr>



</xsl:if>



</table>



</td>



<xsl:if test="position() mod 2 = 0" ddwrt:cf_ignore="1">



<xsl:text disable-output-escaping="yes">&lt;/tr></xsl:text>



<xsl:if test="position() != last()" ddwrt:cf_ignore="1">



<xsl:text disable-output-escaping="yes">&lt;tr></xsl:text>



</xsl:if>



</xsl:if>



<xsl:if test="position() = last()" ddwrt:cf_ignore="1">



<xsl:if test="position() mod 2 != 0" ddwrt:cf_ignore="1">



<td>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</td>



</xsl:if>



</xsl:if>



</xsl:template>



</xsl:stylesheet>













9) Now go back to Search page and open it in edit mode.
Open Home => Search => Site Actions => Edit Page

Here the Core result Web part does not display edit link, so change the url by removing the query string parameter from the url and type contents=1 in the end of the url.

http://ServerName/SearchCenter/Pages/msdnsearchresults.aspx?contents=1

10) It opens the Web Part Page Maintenance.

Home > Search > Pages > MSDNSearchResults > Web Part Page Maintenance
Web Part Page Maintenance: msdnsearchresults

http://ServerName/SearchCenter/_layouts/spcontnt.aspx?&url=%2fSearchCenter%2fPages%2fmsdnsearchresults.aspx

11) Check the "Search Core Results" and delete it by pressing the delete link present in the toolbar.

Check Search Core Results => Delete => Press OK

12) Click Go Back to Web Part Page => Site Actions => Edit Page => Add a Web Part => Check Search Core Results => Add => Publish => Add a Web Part => Check Search Core Results => Add => Publish

13) Now go back to MSDN tab and type some search keyword.
Home => Search => MSDN tab => type keyword => search

14) Now change the xml:stylesheet.
Site Actions => Edit Page => Search Core Results Web Part => Edit link => Modify Share Web Part => Search Core Results => Xsl Editor button => Replace xml:stylesheet with earlier copied xml:stylesheet.

15) Press OK and Publish the page.

16) Now enter some search keyword in newly created tab and start search. It displays search results according to new xml:stylesheet.



It is also possible to categorize the search results display by changing the xml:stylesheet









<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">



<xsl:output method="html" indent="no"/>



<xsl:decimal-format NaN=""/>



<xsl:param name="FileName" />



<xsl:param name="dvt_apos">'</xsl:param>



<xsl:param name="dvt_groupfield" />



<xsl:variable name="dvt_1_automode">0</xsl:variable>







<xsl:template match="/">



<xsl:call-template name="dvt_1"/>



</xsl:template>



<xsl:template name="dvt_1">



<xsl:variable name="dvt_StyleName">Table</xsl:variable>



<xsl:variable name="Rows" select="/All_Results/Result"/>



<xsl:variable name="dvt_RowCount" select="count($Rows)" />



<table border="0" width="100%" cellpadding="2" cellspacing="0">



<tr valign="top">



<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">



<th class="ms-vh" width="1%" nowrap="nowrap"></th>



</xsl:if>



<th class="ms-vh" nowrap="nowrap">id</th>



<th class="ms-vh" nowrap="nowrap">workid</th>



<th class="ms-vh" nowrap="nowrap">rank</th>



<th class="ms-vh" nowrap="nowrap">title</th>



<th class="ms-vh" nowrap="nowrap">author</th>



</tr>



<xsl:call-template name="dvt_1.body">



<xsl:with-param name="Rows" select="$Rows"/>



<xsl:with-param name="FirstRow" select="1" />



<xsl:with-param name="LastRow" select="$dvt_RowCount" />



</xsl:call-template>



</table>







</xsl:template>



<xsl:template name="dvt_1.body">



<xsl:param name="Rows"/>



<xsl:param name="FirstRow" />



<xsl:param name="LastRow" />



<xsl:variable name="dvt_Rows">



<root>



<xsl:for-each select="$Rows">



<xsl:sort select="author" order="ascending" />



<xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow)">



<xsl:copy-of select="." />



</xsl:if>



</xsl:for-each>



</root>



</xsl:variable>



<xsl:for-each select="$Rows">



<xsl:sort select="author" order="ascending" />



<xsl:variable name="NewGroup_0">



<xsl:choose>



<xsl:when test="not ($dvt_groupfield)">



<xsl:value-of select="ddwrt:NameChanged(string(author), 0)" />



</xsl:when>



<xsl:otherwise></xsl:otherwise>



</xsl:choose>



</xsl:variable>



<xsl:choose>



<xsl:when test="0" />



<xsl:when test="not($dvt_groupfield) and (not($NewGroup_0='') and position() &gt;= $FirstRow and position() &lt;= $LastRow or ($FirstRow = position()))">



<xsl:variable name="groupheader0">



<xsl:choose>



<xsl:when test="not (author) and (author) != false()">



<xsl:value-of select="' '" />



</xsl:when>



<xsl:otherwise>



<xsl:value-of select="author" />



</xsl:otherwise>



</xsl:choose>



</xsl:variable>



<xsl:variable name="groupfooter0">



<xsl:choose>



<xsl:when test="$NewGroup_0=''">



<xsl:value-of select="author" />



</xsl:when>



<xsl:otherwise>



<xsl:value-of select="$NewGroup_0" />



</xsl:otherwise>



</xsl:choose>



</xsl:variable>



<xsl:if test="not ((position()=1) or (position()=$FirstRow))">



<xsl:call-template name="dvt_1.groupfooter0">



<xsl:with-param name="fieldtitle">author</xsl:with-param>



<xsl:with-param name="fieldname">author</xsl:with-param>



<xsl:with-param name="fieldvalue" select="$groupfooter0" />



<xsl:with-param name="fieldtype" select="'text'" />



<xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Result[((author)=$groupfooter0 or ((not(author) or author='') and $groupfooter0=' '))]" />



<xsl:with-param name="groupid" select="'0'" />



<xsl:with-param name="displaystyle" select="'auto'" />



<xsl:with-param name="showfooter" select="true()" />



<xsl:with-param name="showfootercolumn" select="false()" />



</xsl:call-template>



</xsl:if>



<xsl:call-template name="dvt_1.groupheader0">



<xsl:with-param name="fieldtitle">author</xsl:with-param>



<xsl:with-param name="fieldname">author</xsl:with-param>



<xsl:with-param name="fieldvalue" select="$groupheader0" />



<xsl:with-param name="fieldtype" select="'text'" />



<xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Result[((author)=$groupheader0 or ((not(author) or author='') and $groupheader0=' '))]" />



<xsl:with-param name="groupid" select="'0'" />



<xsl:with-param name="displaystyle" select="'auto'" />



<xsl:with-param name="imagesrc" select="'/_layouts/images/minus.gif'" />



<xsl:with-param name="alttext" select="'collapse'" />



<xsl:with-param name="altname" select="'expand'" />



<xsl:with-param name="hidedetail" select="false()" />



<xsl:with-param name="showheader" select="true()" />



<xsl:with-param name="showheadercolumn" select="false()" />



</xsl:call-template>



</xsl:when>



</xsl:choose>



<xsl:variable name="BreakOut">



<xsl:choose>



<xsl:when test="not($dvt_groupfield) and position()=$LastRow+1">



<xsl:value-of select="ddwrt:NameChanged('', -1)" />



</xsl:when>



<xsl:otherwise>BreakOut</xsl:otherwise>



</xsl:choose>



</xsl:variable>



<xsl:variable name="dvt_KeepItemsTogether" select="false()" />



<xsl:variable name="dvt_HideGroupDetail" select="false()" />



<xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">



<xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">



<xsl:call-template name="dvt_1.rowview" />



</xsl:if>



</xsl:if>



<xsl:choose>



<xsl:when test="0" />



<xsl:when test="($NewGroup_0 or true()) and not($dvt_groupfield)">



<xsl:variable name="groupfooter0">



<xsl:choose>



<xsl:when test="position() = count($Rows) and ($LastRow &gt;= position() or $dvt_KeepItemsTogether) or not($NewGroup_0) or $NewGroup_0=''">



<xsl:value-of select="author" />



</xsl:when>



<xsl:otherwise>



<xsl:value-of select="$NewGroup_0" />



</xsl:otherwise>



</xsl:choose>



</xsl:variable>



<xsl:if test="(position() = count($Rows) and ($LastRow=position() or $dvt_KeepItemsTogether)) or (not($dvt_KeepItemsTogether) and position() &gt; $LastRow and not($BreakOut='BreakOut')) or (not($dvt_KeepItemsTogether) and position() = $LastRow+1) or (position()=last() and $LastRow &gt; last())">



<xsl:call-template name="dvt_1.groupfooter0">



<xsl:with-param name="fieldtitle">author</xsl:with-param>



<xsl:with-param name="fieldname">author</xsl:with-param>



<xsl:with-param name="fieldvalue" select="$groupfooter0" />



<xsl:with-param name="fieldtype" select="'text'" />



<xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Result[((author)=$groupfooter0 or ((not(author) or author='') and $groupfooter0=' '))]" />



<xsl:with-param name="groupid" select="'0'" />



<xsl:with-param name="displaystyle" select="'auto'" />



<xsl:with-param name="showfooter" select="true()" />



<xsl:with-param name="showfootercolumn" select="false()" />



</xsl:call-template>



</xsl:if>



</xsl:when>



</xsl:choose>



</xsl:for-each>







</xsl:template>



<xsl:template name="dvt_1.rowview">



<tr>



<xsl:if test="position() mod 2 = 1">



<xsl:attribute name="class">ms-alternating</xsl:attribute>



</xsl:if>



<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">



<td class="ms-vb" width="1%" nowrap="nowrap">



<span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span>



</td>



</xsl:if>



<td class="ms-vb">



<xsl:value-of select="id"/>



</td>



<td class="ms-vb">



<xsl:value-of select="workid"/>



</td>



<td class="ms-vb">



<xsl:value-of select="rank"/>



</td>



<td class="ms-vb">



<xsl:value-of select="title"/>



</td>



<td class="ms-vb">



<xsl:value-of select="author"/>



</td>



</tr>



</xsl:template>



<xsl:template name="dvt_1.groupheader0">



<xsl:param name="fieldtitle" />



<xsl:param name="fieldname" />



<xsl:param name="fieldvalue" />



<xsl:param name="fieldtype" />



<xsl:param name="nodeset" />



<xsl:param name="groupid" />



<xsl:param name="displaystyle" />



<xsl:param name="imagesrc" />



<xsl:param name="alttext" />



<xsl:param name="altname" />



<xsl:param name="hidedetail" />



<xsl:param name="showheader" />



<xsl:param name="showheadercolumn" />



<xsl:if test="$showheader" ddwrt:cf_ignore="1">



<tr id="group{$groupid}" style="display:{$displaystyle}">



<td class="ms-gb" style="background:#cccccc;" colspan="99">



<xsl:choose>



<xsl:when test="$groupid='0' or $groupid='9'">



<xsl:text></xsl:text>



</xsl:when>



<xsl:when test="$groupid='1'">



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:when>



<xsl:when test="$groupid='2'">



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:when>



<xsl:otherwise>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:otherwise>



</xsl:choose>



<xsl:if test="not($hidedetail)" ddwrt:cf_ignore="1">



<a href="javascript:" onclick="javascript:ExpGroupBy(this);return false;">



<img src="{$imagesrc}" border="0" alt="{$alttext}" name="{$altname}" />



</a>



</xsl:if>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<b>



<xsl:value-of select="$fieldtitle" />



</b>



<xsl:if test="$fieldtitle">: </xsl:if>



<xsl:choose>



<xsl:when test="$fieldtype='url'">



<a href="{$fieldvalue}">



<xsl:value-of select="$fieldvalue" />



</a>



</xsl:when>



<xsl:when test="$fieldtype='user'">



<xsl:value-of select="$fieldvalue" disable-output-escaping="yes" />



</xsl:when>



<xsl:otherwise>



<xsl:value-of select="$fieldvalue" />



</xsl:otherwise>



</xsl:choose>



</td>



</tr>



</xsl:if>



</xsl:template>



<xsl:template name="dvt_1.groupfooter0">



<xsl:param name="fieldtitle" />



<xsl:param name="fieldname" />



<xsl:param name="fieldvalue" />



<xsl:param name="fieldtype" />



<xsl:param name="nodeset" />



<xsl:param name="groupid" />



<xsl:param name="displaystyle" />



<xsl:param name="showfooter" />



<xsl:param name="showfootercolumn" />



<xsl:if test="$showfooter" ddwrt:cf_ignore="1">



<tr id="group{$groupid}" style="display:{$displaystyle}">



<td class="ms-gb" style="background:#cccccc;" colspan="99">



<xsl:choose>



<xsl:when test="$groupid='0' or $groupid='9'"></xsl:when>



<xsl:when test="$groupid='1'">



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:when>



<xsl:when test="$groupid='2'">



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:when>



<xsl:otherwise>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>



</xsl:otherwise>



</xsl:choose>



<b>



Count : <xsl:value-of select="count($nodeset)" />



</b>



</td>



</tr>



</xsl:if>



</xsl:template>



</xsl:stylesheet>





















Suggested Links:

1) Creating a Custom Search Page and Tabs in the Search Center of SharePoint Server
http://msdn2.microsoft.com/en-us/library/bb428855.aspx

2) Custom XSLT for the Search Core Results Web Part
http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1669


2 comments:

Unknown said...

Can you sort your columns in the Search Core Results web part?

Shola Salako said...

Thanks for posting this. It was especially helpful in troubleshooting managed properties for my search results (XML results). I greatly appreciate your contribution to SharePoint development. Thanks again.

Regards,
Shola

Google