Add View folder link for document search results

In the default document search results it is only possible to open the documents. It is not possible to navigate to the documents location.

Solution

1. Edit the Search Core Results Web part on the Search Center results page.
2. Click on XSL Editor under Display properties.
4. In the XSLT look for the following code.

<xsl:template name="ViewInBrowser">
        <xsl:param name="browserlink" />
        <xsl:param name="currentId" />
        <xsl:if test="string-length($browserlink) &gt; 0">
            <span class="srch-urllink">
                <a href="{$browserlink}" id="{concat($currentId,'_VBlink')}">
                    <xsl:value-of select="$ViewInBrowser" />
                </a>

3. Add the following code after the code for ViewInBrowser.

<!-- Toon View Folder link bij documenten -->    
<xsl:if test="isdocument = 'True'">
  <a>
    <xsl:attribute name="href">
      <xsl:value-of select="sitename"/>
    </xsl:attribute>
    View Folder
  </a>                         
</xsl:if>

4. Save the changes and  enjoy the result.

Result

Share

One Reply to “Add View folder link for document search results”

  1. Thanks for this. Though I had to place the View Folder code in a different location as my environment doesn’t have Office Web Apps installed.
    After this code:
    [code]
    <!– When there is keywory to issue the search –>
    <xsl:template name="dvt_1.noKeyword">
    <span class="srch-description2">
    <xsl:choose>
    <xsl:when test="$IsFixedQuery">
    <xsl:value-of select="$NoFixedQuery" />
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$NoKeyword" />
    </xsl:otherwise>
    </xsl:choose>
    [/code]
    Paste View Folder code.
    Thanks for the Mod.
    Brett

Leave a Reply

Your email address will not be published. Required fields are marked *