Home > Uncategorized > Using OpenSearch.xml

Using OpenSearch.xml

 

If your website is searchable, then you can let your browser know how to search it, and create a shortcut search box in the top right of the user’s browser using a few lines of HTML and XML

Add the line

<link rel=”search” type=”application/opensearchdescription+xml” href=”/opensearch.xml” title=”.NET Source Code” />

to the head of the page, where opensearch.xml is:

<?xml version=”1.0″ encoding=”UTF-8″?>
<OpenSearchDescription xmlns=”http://a9.com/-/spec/opensearch/1.1/&#8221; xmlns:moz=”http://www.mozilla.org/2006/browser/search/”&gt;
<ShortName>.NET Source</ShortName>
<Description>.NET Framework source code</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image height=”16″ width=”16″ type=”image/x-icon”>http://reflector.webtropy.com/images/favicon.ico</Image&gt;
<Url type=”text/html” method=”get” template=”http://reflector.webtropy.com/Search.aspx?search={searchTerms}” />
<moz:SearchForm>http://reflector.webtropy.com</moz:SearchForm&gt;
</OpenSearchDescription>

I’ve used this on my .NET Source code browser website.

 

Advertisement
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: