Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / XSLT

Customizing SharePoint Search Results (Deleting Author & Date)

2.00/5 (1 vote)
12 May 2008CPOL1 min read 1  
Customizing SharePoint Search Results (Deleting Author & Date)

Introduction

I am going to show you how you can change SharePoint default search result screen. Search Core Result web part comes with some field such as title, description, url, author and date. Sometimes you don’t want to show some fields. If you are using SP Search API then you can show any field that you want but we will do it with default web part without coding.

Image 1

Using the code

Let’s create a simple result page. In your web portal click Site Action > Create Page. Select the (Welcome Page) Search Result Page layouts and then click cerate. In the new web page edit the Search Core Result web part. ( Edit > Modify Shared Web Part ). There is an xsl file under the Data View Properties Tab, click XSL Editor button. If you check out this file you can see fields and styles. (Use Visual Studio or another xml editor to editing.. )

Find the “<xsl:with-param name="str" select="author" />” line. As you see, these lines indicate which field will be showen.Now drop lines shown bellow.


Image 2


After modifying click OK and publish the page and search something. You will see a result page like bellow.

Image 3

You can modify this XSL file as you want.

HAVE A NICE MOSS !!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)