Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to edit how the search results render. The default behaviour is to start with a link to the document (or the dispform.aspx of a list item). I was able to change the url value for specific types of documents.

What I now want to do is to replace the title of the result link to not be taken from the "title" or "name" field, but from a custom column I have.

I have already added the column to be crawled and also added it in the fetched properties of the web part.

Now I have to edit the xslt, but I have very little understanding of the language and can't find where the 'title' of the link is stored.

I am using search server express and sharepoint foundation. Thanks in advance!

share|improve this question

1 Answer 1

I know it's been a long time, but I found answer to my question using this simple technique posted for a different question.

I just needed to replace from the default xsl these lines:

  <xsl:otherwise>
    <a id="{concat($currentId,'_Title')}">
      <xsl:attribute name="href">
        <xsl:value-of  select="$url"/>
      </xsl:attribute>
      <xsl:attribute name="title">
        <xsl:value-of select="title"/>
      </xsl:attribute>
    <xsl:choose>
     <xsl:when test="hithighlightedproperties/HHTitle[. != '']">
      <xsl:call-template name="HitHighlighting">
       <xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" /> 
      </xsl:call-template>   
     </xsl:when>
     <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise> 
    </xsl:choose>
    </a>
  </xsl:otherwise>

with this:

  <a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}" target="_blank">
   <xsl:value-of select="xxxxx"/>
  </a>

Where xxxxx is the managed property (in my case 'displayname'). Now the titles of the search results don't get highlighted, but everything else works OK.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.