狂欢‰一夜 发表于 2015-9-29 11:48:13

sharepoint自定义用户搜索结果页

  http://www.imageput.com/hosted/58322peoplesearchresultpageinstructions.swf
  懒的一幅幅上传图片,转成flash了(E水平不行,还请见谅)。
  无法观看,点此下载
  http://www.fileupyours.com/files/245636/PeopleSearchResultPageInstructions.swf

Code
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Columns>
    <Column Name="AccountName"/>
    <Column Name="UserProfile_GUID"/>
    <Column Name="Title"/>
    <Column Name="PreferredName"/>
    <Column Name="JobTitle"/>
    <Column Name="LastName"/>
    <Column Name="FirstName"/>
    <Column Name="Location"/>
    <Column Name="Fax"/>
    <Column Name="Department"/>
    <Column Name="WorkPhone"/>
    <Column Name="OfficeNumber"/>
    <Column Name="AboutMe"/>
    <Column Name="PictureURL"/>
    <Column Name="WorkEmail"/>
    <Column Name="WebSite"/>
    <Column Name="Path"/>
    <Column Name="HitHighlightedSummary"/>
    <Column Name="HitHighlightedProperties"/>
    <Column Name="Responsibility"/>
   </Columns>
</root>  
  

Code
<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="yes"/>
<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="/">
    <style type="text/css">
      .descriptiontitle
      {
      font-size:16px;
      text-transform: capitalize;
      }
      .descriptioncolor {
      color: #C0C0C0;
      font-weight: normal;
      }
      .details
      {
      font-size: 9px;
      color: #155998;
      }
      .details a
      {
      color: #155998;
      }
      .details a:link
      {
      color: #155998;
      }
      .details a:hover
      {
      color: #155998;
      }
      .details a:visited
      {
      color: #155998;
      }
    </style>
    <xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">RepForm3</xsl:variable>
    <xsl:variable name="Rows" select="/All_Results/Result"/>
    <table border="0" width="100%">
      <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:choose>
      <xsl:when test="count($Rows)>0">
      <xsl:for-each select="$Rows">
            <xsl:call-template name="dvt_1.rowview"/>
      </xsl:for-each>
      </xsl:when>
      <xsl:otherwise>
      <span class="ms-sbplain" id="CSR_NO_RESULTS">
   No results matching your search were found.
    <ol>
    <li>Check your spelling. Are the words in your query spelled correctly?</li>
    <li>Try using synonyms. Maybe what you're looking for uses slightly different words.</li>
    <li>Make your search more general. Try more general terms in place of specific ones.</li>
    <li>Try your search in a different scope. Different scopes can have different results.</li>
    </ol>
</span>
      </xsl:otherwise>
      </xsl:choose>
</xsl:template>
<xsl:template name="dvt_1.rowview">
      <tr>
<xsl:attribute name="bgcolor">
                            <xsl:choose>
                              <xsl:when test="position() mod 2=0">#f0f4f5</xsl:when>
                              <xsl:otherwise>white</xsl:otherwise>
                            </xsl:choose>
                        </xsl:attribute>
      <td height="124" align="center" valign="middle">
      <table border="0" cellspacing="0" height="100%" width="100%">
          <tr>
            <td width="25%" rowspan="6"align="center" valign="middle">
               <a href="{url}" id="{concat('HSR_IMGL_',id)}" title="{url}">
                <xsl:variable name="imgid" select="concat('HSR_IMG_',id)"/>
                <xsl:choose>
                  <xsl:when test = "string-length(pictureurl) &gt; 0">
                  <img id="{imgid}" src="{pictureurl}" alt="{preferredname}" border="0" width="115" height="105"/>
                  </xsl:when>
                  <xsl:otherwise>
                  <img id="{imgid}" src="/_layouts/images/no_pic.gif" alt="{preferredname}" border="0"/>
                  </xsl:otherwise>
                </xsl:choose>
            </a>
            </td>
            <td width="25%" colspan="2" style="width: 100%;">
            <spanclass="descriptiontitle">
                <xsl:value-of select="firstname" />
                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve"> </xsl:text>
                <xsl:value-of select="lastname" />
            </span>

            </td>
          </tr>
          <tr>
            <td width="25%" class="descriptioncolor">Department</td>
            <td width="75%" class="descriptioncolor">
            E-mail:
            </td>
          </tr>
          <tr>
            <td width="25%" class="ms-vb">
            <xsl:value-of select="department" />
            </td>
            <td width="75%" class="ms-vb">
            <xsl:value-of select="workemail" />
            </td>
          </tr>
          <tr>
            <td width="25%" class="descriptioncolor">
            Phone Number
            </td>
            <td width="75%" class="descriptioncolor">
            Location
            </td>
          </tr>
          <tr>
            <td width="25%" class="ms-vb">
            <xsl:value-of select="workphone" />
            </td>
            <td width="75%" class="ms-vb">
            <xsl:value-of select="location" />
            </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"></span>
            </td>
            </tr>
          </xsl:if>
          <tr>
            <td width="25%" class="details" colspan="2" style="width: 100%;">
            <a href="{url}">View Full Details</a>
            </td>
          </tr>
      </table>
      </td>
    </tr>
</xsl:template>
</xsl:stylesheet>  
  
  
页: [1]
查看完整版本: sharepoint自定义用户搜索结果页