Home | Index

SearchMonkey Guide

public static function getImage()

string getImage ( string $name )

The function Data::getImage() returns standard icons for use in SearchMonkey presentation applications. The actual return value is a template string, which Yahoo! Search interprets and renders as an icon. SearchMonkey icons help create a standard look-and-feel for presentation applications, which in turn can help improve the relevance of your results to users.

[Note] Note

You may freely use these icons within SearchMonkey, but please do not use them for other purposes.

getImage() only operates for certain presentation application components: key/value pairs, infobar summaries, and infobar blobs (['dict'][n]['name']), ['infobar']['summary'] and ['infobar']['blob']).

If you are creating review ratings, see also Data::getStars() and Data::getStarsFromNum().

Parameters

  • name — Specifies a string XPath query to execute on the DataRSS feed. For a list of valid names, refer to Table C.1, “SearchMonkey Icons”. If the name does not belong to this table, the function returns an invalid template string.

    Table C.1. SearchMonkey Icons

    Name Icon Description
    star_0half A half star review.
    star_1 A one star review
    star_1half A one-and-a-half star review
    star_2 A two star review
    star_2half A two-and-a-half star review
    star_3 A three star review
    star_3half A three-and-a-half star review
    star_4 A four star review
    star_4half A four-and-a-half star review
    star_5 A five star review
    add An "add an item" button
    delete A "delete this item" button
    block A "block this item" button
    edit An "edit this item" button
    alert An alert
    music A music-related item
    buddy A friend on a contact list
    im An instant message
    mail An email or email address
    addressbook An address book or piece of contact information
    call A phone number or voice call button
    down A down arrow
    up An up arrow
    next A next arrow
    help A help item
    warning A warning about a risk to health, equipment, or data
    information An informational note
    search A search
    save A save or download button
    del.icio.us A del.icio.us bookmark
    bookmark A generic bookmark
    blog A blog or blog post
    document A document
    video_camera A video camera
    video A video file or stream
    link A hyperlink
    flag A flagged item
    new A new item
    favorites A favorite item

Returns

A template string designed to be consumed by Yahoo! Search. When the presentation application renders on the search results page, Yahoo! Search resolves the string into an <img> element with the correct src for the specified icon.

If you specify a name that is not present in Table C.1, “SearchMonkey Icons”, the function still returns a template string, but Yahoo! Search displays this invalid template string directly instead of resolving it into an icon <img> element.