Searching the Goblin
After Grant yesterday blogged about search providers in IE7, I thought I might look into what it would take to implementing one here at CrankyGoblin.
It ends up that it's a lot easier than I would have thought - there's no need to edit a single file in the CommunityServer source base, or even in the skins.
When you're logged into CommunityServer as an administrator, you can specify extra HEAD information in the Site Settings - in the Raw Header section of the Site Content pane. So to this I added the following tag:
<link title="CrankyGoblin Blogs" type="application/opensearchdescription+xml" rel="search" href="http://blogs.crankygoblin.com/CrankyGoblinSearch.xml" xmlns="http://www.microsoft.com/MSCOM/MNP2/Schemas" />
By saving it here, it gets rendered in the HEAD section of every page in the CS site.
Then all I had to do was write the xml file that the link links to, which I wrote like this:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>CrankyGoblin Blogs</ShortName>
<Description>Search Blogs.CrankyGoblin.Com</Description>
<Url type="text/html" template="http://blogs.crankygoblin.com/search/SearchResults.aspx?q={searchTerms}" />
</OpenSearchDescription>
I uploaded this file (saved as CrankyGoblinSearch.xml) to the site, and it's all done. Now whenever someone is at blogs.crankygoblin.com, every page will light up as searchable and give the user the option to install the search provider.
So now my only question is: should the link be on every page on the site, or limited to just a few of the pages? Is it wrong to have it on every page? I'm not sure...