Home | Index

SearchMonkey Guide

Creating Presentation Applications

A presentation application is a small PHP application that defines how Yahoo! Search should display search results. This section explains how to create presentation applications using the SearchMonkey developer tool. It includes these subsections:

Presentation Templates

There are two templates that define the basic appearance of a presentation applications: Enhanced Result and Infobar. An Infobar is an expandable pane beneath a search result that provides additional information about the result. An Enhanced Result actually overwrites the search result itself — it can change the title, the summary, and more.

Infobars

Figure 2.15, “Example Infobar: Acme Movies” displays a search result with three Infobars. The search result itself still resembles the default, with the exception of the area highlighted in yellow, beneath the footer. Clicking one of the three Infobars displays an expandable pane with additional information about the search result.

Figure 2.15. Example Infobar: Acme Movies

Example Infobar: Acme Movies

Because Infobars and Enhanced Results behave so differently, users deal with them in fundamentally different ways.

When a user views an Enhanced Result, there is a critical fraction of a second where the user is subconsciously trying to determine whether the result has any relevance. Hence, Enhanced Results use a standard template designed to make it clear that the Enhanced Result is in fact a search result, not an advertisement.

By contrast, when a user views an Infobar, this is always a conscious act. The user has already decided that the result might be relevant, and they are looking for more information. For this reason, Infobars lift some of the restrictions described for Enhanced Result applications:

  • If you specify a title, summary, links, and so on, the expanded Infobar will resemble an Enhanced Result. However, you can also use general HTML markup to create much more customized Infobars. For more information, refer to “Presentation Application PHP Structure”.

  • Unlinke Enhanced Results, in an Infobar you may provide images and links from a different host location than the initial search result. For example, an Infobar designed for wikipedia.org could display a stream of related images from a photo service at a different host link, such as flickr.com or shutterfly.com.

If you set the Trigger URL Pattern to "*" (all search results), the application must be an Infobar. For example, an application that attempts to provide English-to-Japanese translations for Wikipedia pages could be an Enhanced Result, but an application that attempts to translate all search results must be an Infobar.

Enhanced Results

Figure 2.16, “Example Enhanced Result: Acme Movies” displays an Enhanced Search result. The search result has been overwritten with entirely new information.

Figure 2.16. Example Enhanced Result: Acme Movies

Example Enhanced Result: Acme Movies

Because Enhanced Results affect the search result directly, they are limited to a specific set of presentation elements, arranged in a particular format:

  • Title — A string specifying the search result's title. The title appears at the top of the search result in a larger font, and provides the definitive link to the page itself. You can change the text of the title, but not the URL.

  • Summary — A string specifying the search result's summary. The summary appears below the title and to the right of any thumbnail images or supplementary links. If you provide any key/value pairs, these start replacing the summary from the bottom up.

  • Image — A thumbnail image that represents the search result. The thumbnail image appears below the title and to the left of the links, summary, and key/value pairs.

  • Link — An HTML link that either provides more information about the search result, or indicates some sort of action the user can take. Links appear below the title and to the left of the summary and key/value pairs In an Enhanced Result. The URL links must belong to the host of the search result. Your application may include up to four supplementary links.

  • Dict — A key/value pair that displays terse, structured information about the item in the search result, such as review ratings, technical specifications, or hours of operation. Your application may include up to four dictionary values.

To the right, the Enhanced Result displays additional icons that enable users to remove the applications from their preferences or report abuse. At the bottom, a standard footer displays your application's icon, the page's URL, its size in bytes, and a link to the cached version of the page (if available). The only component of the footer that you can modify is the 16x16 icon, which you can use to brand your application in search results.

SearchMonkey uses the parameters you provide in your application's PHP to construct an Enhanced Result according to the rules described above. For example, if you set ['image']['src'] equal to an image URL, SearchMonkey displays the image and places on the left side, below the title and above the footer. This well-defined template helps ensure that Enhanced Results truly look like search results, and maintains a consistent interface for Yahoo! Search users to rely upon. For more guidelines about designing optimal applications, refer to “Presentation Application Best Practices”.

Under certain circumstances, Enhanced Results can automatically display in Infobars:

  • Performance. The overriding concern is to provide users with fast access to basic search results. The search page cannot wait for slow or complex Enhanced Results to render. This is usually not an issue if you construct your application using data that is cached by Yahoo!, such as Yahoo! Index data, native DataRSS feeds, or extracted semantic web data such as RDF and microformats. However, if you rely upon a slow custom data service or if your PHP is computationally intensive, Yahoo! Search may dynamically display your Enhanced Result application to an Infobar, in order to preserve the user experience. Once your application is cached, it can revert back to an Enhanced Result. If your service requires custom data services, you should design the application as an Infobar.

  • Colliding Applications. Since users may have multiple applications in their search preferences, what happens if two or more Enhanced Result applications trigger off of the same URL pattern? In a user's search preference screen, there is an ordering to the user's chosen applications. The Enhanced Result application at the top of the list "wins", and all other Enhanced Result applications automatically display as Infobars.