I noticed the other day after creating the custom People Results page that the button of "Show more options" was not working and when I clicked it, a yellow exclamation of a Java error showed up at the bottom-left of the IE window. After a lot of headache I was able to figure out the problem.
In my quest for the perfect (for our company) people results page I removed the "People Search Box" that was in there by default at the top, in favor of a custom icon and link back to perform another Advanced People Search. Well that was the problem. Apparently for the "Show more results" link to actually work you need to have that search box there.
I added the People Search Box back in and marked it as hidden and everything started working again
Showing posts with label Errors. Show all posts
Showing posts with label Errors. Show all posts
Wednesday, June 16, 2010
Custom People Results
I did not like the results format of a People search so I decided to create my own. On the results page I edited the page, edited the XSL and made this:

To do this, you need to know the values for each column of data. Here is mine, yours may be different but the formatting would be the same:
<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">Table</xsl:variable>
<xsl:variable name="Rows" select="/All_Results/Result"/>
<table border="1" width="100%" cellpadding="4" 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">Name</th>
<th class="ms-vh" nowrap="nowrap">Nickname</th>
<th class="ms-vh" nowrap="nowrap">Title</th>
<th class="ms-vh" nowrap="nowrap">Company</th>
<th class="ms-vh" nowrap="nowrap">Office</th>
<th class="ms-vh" nowrap="nowrap">Phone</th>
<th class="ms-vh" nowrap="nowrap">Extension</th>
<th class="ms-vh" nowrap="nowrap">E-Mail</th>
</tr>
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</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">
<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">
<a href="https://mysite.yourdomain.com/Person.aspx?guid={userprofile_guid}">
<xsl:value-of select="preferredname"/>
</a>
</td>
<td class="ms-vb">
<xsl:value-of select="nickname"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<xsl:value-of select="jobtitle"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<xsl:value-of select="company1"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<xsl:value-of select="officenumber"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<xsl:value-of select="workphone"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<xsl:value-of select="extension1"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</td>
<td class="ms-vb">
<a href="mailto:{workemail}">
<xsl:value-of select="workemail"/>
<script type="text/javascript">
document.write("&nbsp;");
</script>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Possible Error
I did initially run into the problem whereas I was getting this error when trying to display the results of a people search:
System.NullReferenceException:
Object reference not set to an instance of an object. at
System.Xml.XmlNode.RemoveChild(XmlNode oldChild) at
Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.DeleteElementAddToMyColleaguesURL(XmlNode result) at
Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.CreateXmlDocument() at
Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.SortBySocialDistance() at
Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.GetXPathNavigator(String viewPath)
Turns out that the results Web Part needed it's "Default Results View" to be set to "Relevance" instead of "Social Distance" as it had been by default. After that change the error went away.
IE Crashes When Opening Office Docs
Found a user's machine where whenever they opened any Office document IE crashed. This seemed to work:
(not specifically Word) Resolution:
Step 1) Close all Internet Explorer and Office programs/windows
Step 2) Delete this file: C:\Program Files\Microsoft Office\Office 12\OWSSUPP.DLL
Step 3) Run the Microsoft Office Diagnostic located in Start --> Programs --> Microsoft Office --> Microsoft Office Tools --> Microsoft Office Diagnostic
Step 4) It should find 1 error and have fixed it. Now you can open your programs back up and try the SharePoint site. This should fix the problem.
Subscribe to:
Posts (Atom)