The custom list had a column called as Snapshots which was of the type Hyperlink or Picture.
The need was to customize the search results page to display an indicator for list items with images.
To do so, go to SSP - Search Settings - Metadata properties - New Managed property
In the New Managed Property window, do the following-
Enter the property name and select the property type as text
In Mappings to crawled properties - select 'Include values from a single crawled property based on the order specified'
Click on Add mapping and find the custom list column and click Ok
Click OK on the managed property window.
Then Do a full crawl
Edit the search results page and edit search core results webpart
In Result Query option - selected columns, add the custom column
In the XSL editor - add the following
<xsl:variable name="Customicon">
<xsl:value-of select="<enter the column name>" />
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($Customicon)!=0">
<img class="image" src="<path of the custom icon image>" alt="" />
</xsl:when>
</xsl:choose>
To hyperlink the icon add a href tag before image
Click Apply and OK on the Search Core Results Webpart. Checkin and publish the page, to see the changes.
The need was to customize the search results page to display an indicator for list items with images.
To do so, go to SSP - Search Settings - Metadata properties - New Managed property
In the New Managed Property window, do the following-
Enter the property name and select the property type as text
In Mappings to crawled properties - select 'Include values from a single crawled property based on the order specified'
Click on Add mapping and find the custom list column and click Ok
Click OK on the managed property window.
Then Do a full crawl
Edit the search results page and edit search core results webpart
In Result Query option - selected columns, add the custom column
In the XSL editor - add the following
<xsl:variable name="Customicon">
<xsl:value-of select="<enter the column name>" />
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($Customicon)!=0">
<img class="image" src="<path of the custom icon image>" alt="" />
</xsl:when>
</xsl:choose>
To hyperlink the icon add a href tag before image
Click Apply and OK on the Search Core Results Webpart. Checkin and publish the page, to see the changes.
Comments
Post a Comment