zoukankan      html  css  js  c++  java
  • SharePoint:替换搜索结果连接URL 金大昊(jindahao)

    需求:

    对搜索结果(只是针对BCS数据)的URL连接地址替换为需要的url地址。

    解决办法:

     1.编辑“搜索核心结果webpart”。

     2.编辑xsl文件 

      。。。。
      <!--jindahao add replace funcation -->
        <xsl:template name="string-replace-all">
          <xsl:param name="text" />
          <xsl:param name="replace" />
          <xsl:param name="by" />
          <xsl:choose>
            <xsl:when test="contains($text, $replace)">
              <xsl:value-of select="substring-before($text,$replace)" />
              <xsl:value-of select="$by" />
              <xsl:call-template name="string-replace-all">
                <xsl:with-param name="text"
                select="substring-after($text,$replace)" />
                <xsl:with-param name="replace" select="$replace" />
                <xsl:with-param name="by" select="$by" />
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$text" />
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>
    <xsl:template match="Result">
            <xsl:variable name="id" select="id"/>
            <xsl:variable name="currentId" select="concat($IdPrefix,$id)"/>
            <xsl:variable name="url" select="url"/>
            <!--jindahao add myUrl -->
            <xsl:variable name="myUrl">
              <xsl:call-template name="string-replace-all">
                <xsl:with-param name="text" select="url" />
                <xsl:with-param name="replace" select="'http://10.246.5.201:80/ProfilePages/_bdc/http___2k8-r2x64en/riskcontrol1_1.aspx'" />
                <xsl:with-param name="by" select="'http://www.baidu.com'" />
              </xsl:call-template>
            </xsl:variable>

     3.保存webpart 

    努力后就不会后悔

  • 相关阅读:
     一、cocos2dx之如何优化内存使用(高级篇)
    latex模版&&c++ STL用法&&画图网站
    HDU 3480 Division
    HDU 3045 Picnic Cows
    HDU 2993 MAX Average Problem
    HDU 3507 Print Article
    Luogu P2900 [USACO08MAR]土地征用Land Acquisition
    浅谈斜率优化
    POJ 2559 Largest Rectangle in a Histogram
    【计算几何】求半平面交的面积
  • 原文地址:https://www.cnblogs.com/jindahao/p/2438897.html
Copyright © 2011-2022 走看看