Posts tonen met het label Core Search Result. Alle posts tonen
Posts tonen met het label Core Search Result. Alle posts tonen

zondag 24 juni 2012

Refinements, "Show More" link stopped working

I recently discovered that the “Show More” link on the Search Refinement Panel web part 
had stopped working, seemingly out of the blue.  
With a bit of debugging I discovered that the functions defined in the onclick event:
onclick="SearchEnsureSOD();ToggleRefMoreLessFilters(this, true);"
were returning “Object Expected”.  
For some reason the functions were no longer defined.

I eventually figured out that the problem was that I had removed the Search Box web part 
from the page and replaced it with my own custom search box.  

Apparently the Search Box web part is required on the same page as the Refinement Panel web part,
as it injects JavaScript into the page that is used by the Refinement Panel.  

I fixed the problem by adding the Search Box web part back onto the page and hiding it.

 

vrijdag 30 maart 2012

Customizing the Search Results Page (XSLT) – Add highlighting


Thanks to Tobias Zimmergren I found out how to add Word Highlighting your Search Result Page.

 
Customizing the Search result page xslt by adding Highlighting

What you have to do is to adapt the XSL code in the XSLT Editor of the Core Search Result 
webpart and locate the the following section (It already exist):


<xsl:template name="Hithightlighting">
 

And since this template exists from the beginning, all you really have to do is to customize 
the style attribute and add a color property of the <b> tag 
(I replaced it with a <strong> tag instead, for sake of standards)

Then you can simply specify the styles for each highlighted word like following:
 <xsl:template match="c0">
 <strong style="color:blue;"><xsl:value-of select="."/></strong>
 </xsl:template>
 

It’s simple as that. I hope this helped some of you to get started 
on some basic Search Core Results XSLT customizations. 


For customizing the result itself you can take also a look 
at the blog of customize the search result using Sharepoint Designer.