Archive for the ‘XSL’ Category

How to show different looking results based on subcollection

March 9, 2006 in Google Mini,XML API,XSL | Comments (3)

A common question is “How can I make the Google Mini show a different results page depending on the subcollection being used?” You might want to do this because you have a search covering an intranet and public area, or just two very different sites.

The Mini can only show one design of results on it’s own, i.e. through the normal results page it shows, based on the XSL you can set up in the ‘Configure Serving -> Output Format’ section of the admin area. However, as long as you have a scripting language on your web server (e.g. PHP, ASP, ColdFusion, Perl) you can use the XML interface to get the results back, then change the way they look in one of two ways:

  1. Trigger some XSL with the scripting language, making it look the way you want – you can use the admin area of the Mini to design the XSL if it helps
  2. Alternatively, use the scripting language to parse the XML, and display it how you want. This is probably more convenient if you do not know XSL and do not have time to learn it, but do know some programming. Doing this in ColdFusion (MX or 7), ASP (v3 or above) or PHP 5 is relatively straightforward if you all ready know some XML, it’s slightly harder in PHP 4, but still very possible with a little more effort

These give you the flexibility of being able to choose a method that best suits you or your developers, and gives you a lot of control over the look and feel of search results.