Home > SharePoint 2010 > How to customise search core results web part Part1

How to customise search core results web part Part1

In this post, I’d like to show you how to customise search core results web part. It is a quite simple, most of the times what you need to do is to change the xslt to perform the changes. Here are the steps:

1. You need to change the xslt to the following, so that you can see the raw 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>
a. To do so , you need to go to edit page>>Edit search core results web part >>Display Properties and then untick use Location Visualization

b. Open the xslt editor and copy the existing XSLT code to your preferred xslt editor so that you can customise it.

c. Now you can paste in the XSLT code above.

2.Perform the search after you have completed step1 and you will see the search results returned in raw xml

      <description>Ybbest test site</description>
        <c0>Ybbest</c0> test site <ddd /> Add a new image, change this welcome text or add new lists to this page by clicking the edit button above. You can click on Shared Documents to add files or on the <ddd /> </hithighlightedsummary>
      <popularsocialtags />
      <imageurl imageurldescription="SharePoint Site Collection">/_layouts/images/siteicon_16x16.png</imageurl>

3. Then you can read what has been returned in the raw xml and start modifying the xslt to customise your search results page.

4.You can also link an external xslt to the web part.It can be set in the Miscellaneous of Web Part section.

You can also set it pragmatically using a feature receiver , you can download the source code to do so here.





  1. September 22, 2012 at 4:10 am


  2. Khushi
    August 14, 2013 at 9:04 am

    Can we increase the Result per page property? or do we need to extend the CoreResultsWebPart and override ConfigureDataSourceProperties ?

  1. September 24, 2014 at 3:23 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: