Google Dominoes allows you to create templates for your search results. This template tag system emulates Movable Type's Template Tag System, as it has shown to provide MovableType bloggers with a flexible system for laying out their blogs. The Google Dominoes templating system aims to provide users with the same level of flexibility.
These tags provide metadata about the search results themselves. The following example describes how Google displays this information at the top of a page of search results.
Results <b><GDStartIndex/> - <GDEndIndex/></b> of about <b><GDEstimatedTotalResultsCount/></b> for <b><GDSearchQuery/></b> (<b><GDSearchTime/></b> seconds)
Message intended for display to an end user.
One of the most common messages found here is a note that
"stop words" were removed from the search automatically
(this happens for very common words such as "and" and "as").
Note: Although Google declares that this message will be returned
through their web API, I have only seen it return null.
The estimated total number of results returned for the query.
Attributes | Type | Default | Description |
---|---|---|---|
format | boolean | true | Choose to format the number so that commas appear between every set of three digits, making it easier to read. Unformatted, a big number may appear as 37600000; however if that number were formatted, then it would appear as 37,600,000. |
The template inside the <GDResults> tag will be applied to each search result from the query. Thus, all tags that start with GDResult may only be used inside this tag. Below is a rough example of how these tags could be used to model Google's existing layout for search results (though this would display the results in reverse-alphabetical order).
<GDResults order="title" ascending="false"> <p> <a href="<GDResultURL/>"><GDResultShortcutIcon/> <GDResultTitle/></a> <br/> <font size="-1"> <GDResultIfSnippet> <!-- the snippet will only display if it is non-null --> <GDResultSnippet/> <br/> </GDResultIfSnippet> <font color="#008000"><GDResultURL/> - <GDResultCachedSize/></font> - <GDResultCachedPage/> - <GDResultSearchRelated/> <br/> </font> </p> </GDResults>
If http://www.bolinfest.com/dominoes/ were among the list of search results, then it would appear as:
Google Dominoes
Google Dominoes. ... Google Dominoes is an extension for either the Firefox or Mozilla
web browser that provides you with a special kind of Google toolbar. ...
http://www.bolinfest.com/dominoes/ - 3k
- Cached
- Similar Pages
A container tag that represents the search results from your query. Currently, the GDResults tag may only appear once in your template.
Attributes | Type | Default | Description |
---|---|---|---|
order | visited, google, or title | visited |
For visited, links in your browser history will be listed before those not in your history. For google, results will be listed in the order returned by Google. For title, results will be listed in alphabetical order by the title of each result. |
ascending | boolean | true | If true, then items will be sorted in the default order of the sort (A-Z, 1-10, etc.). |
The title of the search result, formatted as HTML to highlight the search terms. If no title is available, then the URL of the search result will be used (without HTML formatting).
A container tag for the <GDResultSnippet> tag. If there is a snippet for the search result, then any HTML within this tag will be printed and each <GDResultSnippet> will be replaced with the value of the snippet.
A snippet which shows the query in context on the URL where it appears. This tag may only appear between open and closing <GDResultIfSnippet> tags.
A container tag for the <GDResultSummary> tag. If there is an ODP summary for the search result, then any HTML within this tag will be printed and each <GDResultSummary> will be replaced with the value of the ODP summary.
The ODP summary if this document is contained in the ODP directory. This tag may only appear between open and closing <GDResultIfSummary> tags.
The size in kilobytes of the cached version. This is 0 if the cached version of the URL is not available.
Provide a hyperlink to search for pages similar to this one.
Attributes | Type | Default | Description |
---|---|---|---|
label | string | Similar Pages | The text that appears in the hyperlink. |
Provide a hyperlink to Google's cached version of this page.
Attributes | Type | Default | Description |
---|---|---|---|
label | string | Cached | The text that appears in the hyperlink. |
Load the "favorites" icon for the web site, if available. If the URL of the site is something like http://www.somesite.com/subdir1/subdir2/index.html, then GDResultShortcutIcon will do the following:
Attributes | Type | Default | Description |
---|---|---|---|
border | nonnegative integer | 0 | The width of the image border, in pixels. |
The index (1-based) of the result within the list of search results in the order that Google returned it.
The index (1-based) of the result within the list of search results after the search results have been sorted. Thus, if the order of the <GDResults> tag is google, then the <GDResultGoogleIndex> of a search result will be the same as its <GDResultSortedIndex>. If a different order is used, then the <GDResultSortedIndex> of the result may be different, as the position of the result within the result list may have changed due to sorting.
The spelling tags can be used together as follows:
<GDIfSpellingSuggestion> <p><font color="red">You probably meant to search for:</font> <GDSpellingSuggestion/></p> </GDIfSpellingSuggestion>
Thus, if the user used Google Dominoes to query for pairr of pantz, then he would see:
You probably meant to search for: pair of pants
But if he searched for pair of pants, then he would see no additional HTML at all because Google does not provide any spelling suggestions for that query.
The Miscellaneous Tags may be used together to create the familiar Google search box. The following template
<table> <tr> <td><font size="+2"><GDGoogleLogoKnockoff/></font></td> <td><GDSearchBox size="40" searchLabel="Search Google" luckyLabel="Feeling Lucky?"></td> </tr> </table>
would render the following HTML:
This is a hokey HTML representation of the Google logo that is so poor that it is unlikely to violate any copyright laws (though I believe that this approximates what was displayed on the original Google home page).
This is a text box with a search button to perform another Google Dominoes query.
Attributes | Type | Default | Description |
---|---|---|---|
size | positive integer | 50 | The size of the <input> text box. |
searchLabel | string | Search | The text that appears on the first button for the form. This button will do a Google Dominoes search for the value in the text box. |
luckyLabel | string | I'm Feeling Lucky | The text that appears on the second button for the form. This button will do a Google Dominoes "I'm Feeling Lucky" search for the value in the text box. |
This provides a set of navigation links to go to the next or previous page of search results.
A container tag that contains HTML that will be displayed if there are no results for the query. Other tags may be contained within this tag. Here is an example of how the tag could be used to imitate the message that Google displays when there are no search results.
<GDIfNoResults> Your search - <b><GDSearchQuery/></b> - did not match any documents.<br/> No pages were found containing <b>"<GDSearchQuery/>"</b>. </GDIfNoResults>