Monday, February 20, 2012

SharePoint 2010 'Search Results' page design.

Requirements:

I had the following
requirements in my current project related to the search on the site collection:
  • "Did you mean xyz" i.e. spelling suggestions, to appear on the search results page.
  • Remove the "search connector" icon to be removed from the results page.

Constraints

You cannot edit the "Osssearchresults.aspx" page because it's an application page.

At the same time i also have the main constraint of not to create a new 'Search Center' site as I need to have the branding restored on the search results page. And as soon as you change the master page and CSS for search results page you run into all sorts of problems! So this was ruled out.

What I did

  • Go to the pages library of the site.
  • Click on "New Document" and select Blank Web Parts page. I selected this layout because I think that I will get the best layout of the results page in this template only.
  • I named it as "Results.aspx" .
  • Add all the web parts on this page in the following manner. Be patient you have to add 8 web parts! :-)

  • In order to get the "Spelling suggestions", edit “Search Core Results” page and check the check-box corresponding to SHOW MESSAGES.
  • In order to remove “search connector” icon, edit the “search action links” web part and ‘uncheck’ the option. There are other options that you'll see.
  • Till now, this is just a simple page. In order to make it a search results page, go to the site collection settings and select “Search Settings”.
  • Select the first option and write the relative URL in the box as: /sites/blah-blah/pages/results.aspx. Do the same for the "Site coll. page" i.e. the third option.

Now you'll receive the search results on this page.

One last thing - Edit the "Search Box" web part and under "Miscellaneous", in the 'Advanced Search page URL' and 'Target search results page URL' write the complete URL of your new search page: http://abc.xyz.com/sites/blah-blah/pages/results.aspx.

You'll see n number of things when you'll edit these web parts (esp. 'Search Core Results' and 'Search Box' web parts) that you can do without writing a piece of code!

No comments:

Post a Comment