Sunday, May 16, 2010

Customizing the Search Result By XSLT Using Dataform View

  1. Choose Site Actions -> Edit Page
  2. Locate the "Search Core Results" web part, and choose "Edit" -> "Modify Shared WebPart"
  3. Locate "Data View Properties" and choose the huge "XSL Editor..." button :)

Step 1)Modify the XSLT of the Search Core Results Web Part to get the raw XML

Step 2)
Replace the existing XSLT markup from the Search Core Results Web Part with the following snippet (which basically just give us the raw XML output when searching): as shown  in above

Step 3)Make use of the raw XML that SharePoint generated for us in the Search Core Results Web Part (Save this xml  file)

  Step  4)Open  the ASPX page in sharepoint designer and add DataFormview Webpart and Provide datasource as this xml file. Click on Change layout.Do the necessary changes.

Step 5)Get  the generated xml and  Paste in Search Core Results WebPart's XML-section.

Step 6)Publish this page and find the required output

Some more example  for XSLT transformations
1)Building a Pivot View Web Part based on Multi-value Column
2)Extending Custom Query Webparts
... Will be adding some more examples

1 comment:

Lauraine said...

Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
html5 player| html5 video player