I am trying to change the icon for the "Link to Document" on the searchResult.aspx page. I added following to the xslt of the result but then the result webpart never renders meaning the code is broke. I tried to follow SP2007 article (http://msdn.microsoft.com/en-us/library/cc789805(v=office.12).aspx) but my environment is SP 2010. Please suggest.
<div class="srch-Icon" id="{concat($currentId,'_Icon')}">
<xsl:if test="contenttype='LegalLinkedDocument'">
<img align="absmiddle" src="_layouts/images/legalLinkedIcon.gif" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:if>
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
I believe there is a bug that prevents the ContentType metadata property being used (see http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/cd059e1c-7af6-454c-8568-a22e7755ce8c)
You need to create a new managed metadata property and map it to the ows_ContentType crawled property (I called mine CType), after this do a full crawl (you may need to delete the index first) to have the property available in the search index.
Then edit the Search Core Results web part and add
to Fetched Properties (under Display Properties) after
<columns>
Then update your xml to the following