Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Peter Cooperx http://www.petercooper.co.uk/

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

How to create a OpenSearch reference for your site (as used by Firefox 2's search box)

Create a file like this one as used for Wikipedia, but that refers to your own site's search:

   1  
   2  <?xml version="1.0"?>
   3  <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   4  <ShortName>Wikipedia (English)</ShortName>
   5  <Description>Wikipedia (English)</Description>
   6  <Image height="16" width="16" type="image/x-icon">http://en.wikipedia.org/favicon.ico</Image>
   7  <Url type="text/html" method="get" template="http://en.wikipedia.org/w/index.php?title=Special:Search&amp;search={searchTerms}"/>
   8  <Url type="application/x-suggestions+json" method="GET" template="http://en.wikipedia.org/w/api.php?action=opensearch&amp;search={searchTerms}"/>
   9  </OpenSearchDescription>


Then link to it from your pages like so:

   1  
   2  <link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (English)" />
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS