Personal tools
You are here: Home Products PLOS Documentation How-tos Autodiscovery
Document Actions

Autodiscovery

This How-to applies to: Any version.

Search engines that publish OpenSearch description documents can assist search clients in the discovery of OpenSearch interfaces through the use of "link" elements. Search engines that support OpenSearch should include a reference to the related OpenSearch description document on each page of search results.

HTML and XHTML documents may reference related OpenSearch description documents via the HTML 4.0 <link/> element.

Search Template

To enable autodiscovery for your OpenSearch change:

<metal:block metal:fill-slot="head_slot">
<link rel="alternate" title="RSS 1.0" type="application/rss+xml"
tal:condition="request/SearchableText|nothing"
tal:attributes="href string:$here_url/search_rss?${request/QUERY_STRING}"/>
</metal:block>
to:
<metal:block metal:fill-slot="head_slot">
<!--link rel="alternate" title="RSS 1.0" type="application/rss+xml"
tal:condition="request/SearchableText|nothing"
tal:attributes="href string:$here_url/search_rss?${request/QUERY_STRING}"/-->
<link rel="alternate" title="RSS 2.0 Open Search" type="application/rss+xml"
tal:condition="request/SearchableText|nothing"
tal:attributes="href string:$here_url/plos-rss.xml?${request/QUERY_STRING}"/>
<link rel="alternate" title="Atom Open Search" type="application/atom+xml"
tal:condition="request/SearchableText|nothing"
tal:attributes="href string:$here_url/plos-atom.xml?${request/QUERY_STRING}"/>
<link rel="search" type="application/opensearchdescription+xml" title="Open Search Description"
tal:attributes="href string:${here_url}/plos-description.xml"/>
</metal:block>

in the <head> section of your search template (portal_skins/plone_forms/search.pt)

In the same template you might also want to change:
       <tal:syndicate condition="syntool/isSiteSyndicationAllowed">
<a href="" tal:attributes="href string:$here_url/search_rss?${request/QUERY_STRING}">
<img i18n:attributes="title title_rss_feed; alt label_rss_feed;"
tal:attributes="src string:$portal_url/rss.gif"
src="rss.gif"
alt="RSS Feed"
title="RSS feed of these search results" />
</a>
</tal:syndicate>

to:

        <tal:syndicate condition="syntool/isSiteSyndicationAllowed">
<a href="" tal:attributes="href string:$here_url/plos-rss.xml?${request/QUERY_STRING}">
<img i18n:attributes="title title_rss_feed; alt label_rss_feed;"
tal:attributes="src string:$portal_url/rss.gif"
src="rss.gif"
alt="RSS Feed"
title="RSS feed of these search results" />
</a>
<a href="" tal:attributes="href string:$here_url/plos-atom.xml?${request/QUERY_STRING}">
<img tal:attributes="src string:$portal_url/atom.png"
src="atom.png"
alt="Atom Feed"
title="Atom feed of these search results" />
</a>
</tal:syndicate>

Main Template

To enable autodiscovery on all your pages add:
<link rel="search" type="application/opensearchdescription+xml" title="Open Search Description"
tal:attributes="href string:${portal_url}/plos-description.xml"/>
to the <head> section of your main_template.

by Christian Ledermann last modified May 24, 2007 - 11:40

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by