2012-09-24 69 views

回答

3

你需要这个元标记

<link rel="search" type="application/opensearchdescription+xml" href="[your url]/opensearch.xml" title="[Your title]" /> 

您可以在这里找到http://www.opensearch.org/Home

更多信息,您的XML文件看起来像

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> 
    <ShortName>[Name]</ShortName> 
    <Description>[Desc]</Description> 
    <Image height="16" width="16" type="image/x-icon">[ico]</Image> 
    <Image height="64" width="64" type="image/png">[png]</Image> 
    <Url type="text/html" method="get" template="[url]/?q={searchTerms}"/> 
    <Url type="application/opensearchdescription+xml" rel="self" template="[url]/opensearch.xml"/> 
</OpenSearchDescription> 
+0

它希望像“页面的输出作为HTML“或”XML数据“? –

+0

它会使用你的普通html页面。 ''url =“text/html”method =“get”template =“[url] /?q = {searchTerms}”/>'应该指向您的常规搜索页面,只需替换为{{searchTerms}查询通常会去 –