Friday, February 02, 2007

You can attach the search functionality of your web site right into MSIE 7.0.  If you're using IE7, check out the search widget and see for yourself.

 

What you need:

  • An XML file (or script that generates XML) in the Open Search Description schema.
  • Add a <link /> tag in the <head> section that points that XML file or script

Here is the link tag I added to the hometemplate.blogtemplate dasBlog file:

<link rel="search" type="application/opensearchdescription+xml" href="/blog/opensearch.xml" title="In Chris Velazquez's words" />

I put this right before the line that has <%radio.macros.headLinks ()%>.  I'm not a dasBlog guru, or I would figure out how to get this in as a headLink.  Suggestions are welcome!

Now I need the file (opensearch.xml) that it points to:

<?xml version="1.0"?>
    <OpenSearchDescription
        xmlns="
http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>In Chris Velazquez's words</ShortName>
    <Description>In Chris Velazquez's words</Description>
    <Url type="text/html" method="get" template="
http://www.chrisvelazquez.com/blog/SearchView.aspx?q={searchTerms}"/>
</OpenSearchDescription>

The template attribute has {searchTerms}, which is where the parameter would normally be entered.

 

Here are some of the custom search providers I use in MSIE 7