wet_opensearch is a plugin for Textpattern which adds an OpenSearch template to your site as specified by the OpenSearch specification.
Additionally, it contains a tag which renders the necessary markup allowing search clients like modern browsers to discover your on-site search facility. Visitors can easily add the site search to their browser’s list of search providers.
Usage
Place this tag somewhere into the <head>...</head> element of your site to add an OpenSearch auto discovery link:
<txp:wet_opensearch_link />
In case your Textpattern site search is not handled by the “default” section and its page template, you’d have to specify the URL of the search section, starting at your Textpattern root folder (omit any leading slash):
<txp:wet_opensearch_link searchurl="search" />
Finally, there are two attributes supporting branding. One is used to specify a 16 × 16 pixel icon, while the other designates a 64 × 64 pixels PNG avatar (though I’m not really sure where this will be visible…). The specs say a browser would expect a fully qualified URL here, and so does this plugin.
<txp:wet_opensearch_link favicon="http://www.example.com/myicon.ico" avatar="http://www.example.com/smiley.png" />
Required attributes
None.
Optional attributes
| attribute | description | default |
|---|---|---|
| searchurl | A path starting at your site’s Textpattern root which displays search results. If your site uses the default section to list search term hits, leave this empty. If you employ a special section like /search/ to display search hits, enter the search section’s URL without a leading slash (i.e. “search/”). |
Empty |
| favicon | The URL of a 16 × 16 pixel icon for your site. | http://www.example.com/
{txp-root}/favicon.ico |
| avatar | The URL of a 64 × 64 pixel PNG image for your site. | None |
Licence
This plug-in is released under the Gnu General Public Licence.
Download
Get it here: wet_opensearch.txt.
Resources and Relateds
Express your suggestions, report bugs and discuss enhancements in this thread in the Textpattern forum.
Credits
This plugin was inspired by DeWitt Clinton’s post Add OpenSearch to your site in five minutes.
Change log
| Date | Version | Notes |
|---|---|---|
| 2007-02-10 | 0.1 | Initial public release |
