Friday, October 19, 2012

How to add a custom value in the search core results

By the Search Core Results webpart you can show the results of your search in a custom page of your site.
The default behaviours of this web part is show the default columns but if you want to show a your custom column you need to do some little steps. I show you!

First of all open the SharePoint Central Administration –> Manage service applications –> Search Service Application and click on Manage –> Metadata Properties:

metadata properties

in this form click New Managed Property:

add new managed property

fill in the form:

new managed property form

then click ok and run the crawler:

then come back to you Search Core Result web part that you want customize and go to edit properties:

search core result xsl editor

and fill in with the following xml:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > 
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/><xmp>
<xsl:template>
<xsl:stylesheet>


and the result will be:



now you are ready to modify the xslt: http://salvatoredifaziosharepoint.blogspot.it/2012/04/how-to-modify-sharepoints-result-page.html


Winking smile

No comments:

Post a Comment