The result is that you can add a search engine in firefox, and search in the site like in this screenshot:
First you have to create a controller to server XML for OpenSearch:
def site_osd = {
render(template: '/common/site_osd', contentType:"text/xml")
}
"/site_osd"(controller:'home', action: 'site_osd')
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>${message(code:'search.opensearch.title')}</ShortName>
<Description>${message(code:'search.opensearch.description')}</Description>
<Url type="text/html" method="get" template="${createLink(controller: 'search', absolute: true)}?q={searchTerms}"/>
</OpenSearchDescription>
<link rel="search" href="${createLink(controller:'home',action:'site_osd')}" type="application/opensearchdescription+xml" title="${message(code:'search.opensearch.title2')}"/>
No comments:
Post a Comment