posts - 41, comments - 200, trackbacks - 0

My Links

News

These postings are provided "AS IS" with no warranties, and confers no rights.
Locations of visitors to this page virtusa corp sharepoint virtusa.com shehan peruma

Tag Cloud

Archives

Post Categories

Highlight Search Results

OOTB the Search Core Results webpart simply emphasizes the search string you entered in the Search Box by wrapping it within the <b></b> tags. But let’s say you need to highlight the search terms in different colors; what do you do? Write a new results webpart? No! you only need to adjust the Search Core Results  XLS.

This is how it’s done:

  • Open up the XLS editor and copy the contents  to notepad or some other  editor (if your fine with editing it in the MOSS’s default editor, go right ahead)
  • Search for the term <xsl:template match="ddd">
  • Just below that you will see :
 <xsl:template match="c0">

<b><xsl:value-of select="."/></b>

</xsl:template>

<xsl:template match="c1">

<b><xsl:value-of select="."/></b>

</xsl:template>

And this goes on till “c9”. The values “c0” to “c9” correspond to the search terms you entered, where “c0” is the first, “c1” is the second and so on…

  • Replace this with something like:
  <xsl:template match="c0">

    <strong style="background-color: #CCCCFF">

      <xsl:value-of select="."/>

    </strong>

  </xsl:template>

  <xsl:template match="c1">

    <strong style="background-color: #CCFFFF">

      <xsl:value-of select="."/>

    </strong>

As you can see I’ve used the style “background-color” to give each search term its own color.
  •  Once done copy the updated XLS file back to the webpart and save

Searching for "microsoft sharepoint server"

with the default XLS:
with default XLS






with the modified XLS:

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Thursday, February 21, 2008 1:38 PM | Filed Under [ MOSS Search Branding Administration & Configuration ]

Feedback

Gravatar

# re: Highlight Search Results

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the collegea, and it has same topic with your article. Thanks, great share.

Thanks
H&M Shopping Online
2/17/2011 9:39 AM | Shopping Online Guides
Gravatar

# re: Highlight Search Results

Thank you for this blog. Thats all I can say. You most definitely have made this blog into something thats eye opening and important. You clearly know so much about the subject, youve covered so many bases. Great stuff from this part of the internet. Again, thank you for this blog.Thanks
11/14/2011 8:03 AM | thomasville home office furnitur
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: