Cześć,
Korzystam z tego poradnika.
http://davidwalsh.name/open-searchUtworzyłem 2 pliki.
Pierwszy plik nazwałem "opensearch.xml" i zawiera on coś takiego:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>David Walsh</ShortName>
<LongName>David Walsh Blog Search</LongName>
<Description>Search through articles posted on the David Walsh Blog</Description>
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<Developer>David Walsh</Developer>
<Contact>david@davidwalsh.name</Contact>
<Description>Search for web-related topics like PHP, CSS, XHTML, jQuery, MooTools, and much more!</Description>
<Tags>php css david walsh xhtml jquery mootools programming mysql xml</Tags>
<Attribution>Search data from David Walsh, <a href="http://davidwalsh.name/</Attribution>" target="_blank">http://davidwalsh.name/</Attribution></a>
<SyndicationRight>open</SyndicationRight>
<Query role="example" searchTerms="Apple"/>
<Image height="16" width="16" type="image/vnd.microsoft.icon">http://davidwalsh.name/favicon.ico</Image>
<Image height="64" width="64" type="image/png">http://davidwalsh.name/dw-content/opensearch64.png</Image>
<Url type="text/html" template="http://davidwalsh.name/?s={searchTerms}"/>
</OpenSearchDescription>
A drugi plik nazwałem "index.htm"
i zawiera on coś takiego:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <link rel="search" type="application/opensearchdescription+xml" href="opensearch.xml" title="David Walsh Blog Search" />
<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading
</div> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1');
google.setOnLoadCallback(function(){
new google.search.CustomSearchControl().draw('cse');
}, true);
I nie działa