r8 - 10 May 2008 - 17:22:28 - MartinWehnerYou are here: TWiki >  Treasurelicious Web > WidgetHelp

Widget Help

Treasurelicious offers two widgets:

  • JavaScript: For use in most blogs
  • Flash: For use on more restrictive networking sites, such as MySpace and Facebook (requires Flash Player 9 or higher)

HTML markup

To include the JavaScript widget in your blog or personal home page, use the following HTML markup:

<script type="text/javascript" src="http://www.treasurelicious.com/e/js?id=8&count=15"></script>

To include the Flash widget in your blog or personal home page, use the following HTML markup:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" height="300" width="200"><param name="movie" value="http://www.treasurelicious.com/e/swf?id=8&amp;count=15"><embed pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" src="http://www.treasurelicious.com/e/swf?id=8&amp;count=15" height="300" width="200"></object>

Parameters

The following table lists the possible parameters to use for the Treasurelicious widget. Append them to http://www.treasurelicious.com/e/js?, separated by ampersand signs (&).

Examples:

  • http://www.treasurelicious.com/e/js?id=8
  • http://www.treasurelicious.com/e/js?id=8&count=10&sort=name

Name Description Required/Optional Available Example
id Account identifier (numeric) Required JavaScript, Flash id=8
count Number of treasures to show. Defaults to 15. Optional JavaScript, Flash count=10
tag Tag to filter list of treasures by Optional JavaScript, Flash tag=electronics
sort Controls how treasures are sorted. name=Sort by name of the treasure; created=Sort by the creation timestamp in reverse order (i.e. show newest treasures first). Defaults to created. Optional JavaScript, Flash sort=created
divId Name to give to the div that is created to hold the treasures. This can be used for custom skinning. Optional JavaScript divId=myTreasures
magnify Controls whether thumbnail images are magnified when the cursor hovers over them (1=yes, 0=no). Defaults to 1. Optional JavaScript magnify=0

Restrictions

For a treasure to show up in your widget:

  • The treasure must have been created at least 10 minutes ago
  • The treasure must be marked as being active (i.e. not deleted)
  • If a tag was specified via the tag parameter, the treasure must contain the specified tag
  • The treasure must be within the first count treasures after the sorting function has been applied

Examples

Newest treasures

The five newest treasures.

<script type="text/javascript" src="http://www.treasurelicious.com/e/js?id=8&count=5&sort=created"></script>

Sorted by name

First five treasures, sorted by name.

<script type="text/javascript" src="http://www.treasurelicious.com/e/js?id=8&count=5&sort=name"></script>

Skinning

If you'd like to customize the way your list of treasures looks, you can apply your own look-and-feel by designing your own skin. A DOM inspector (e.g. Firebug) is useful in determining the structure of the output generated by the widget.

You may also find the divId parameter useful to assign a different id to the element which encloses the list of treasures.

An example may best illustrate how to skin the widget:

<style type="text/css">
div#custom div#custom-treasures div.tlish-treasure {
    margin-top: 5px;
    margin-bottom: 5px;
}
div#custom div#custom-treasures div.tlish-treasure div.tlish-image {
    background-color: yellow;
}
div#custom div#custom-treasures div.tlish-treasure div.tlish-caption a {
    background-color: #ffff00;
    color: #00ff00;
    text-decoration: none;
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
}
</style>

<script type="text/javascript" src="http://www.treasurelicious.com/e/js?id=8&count=5&sort=name&divId=custom"></script>

Other systems

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r8 < r7 < r6 < r5 < r4 | More topic actions
 
Logo: Treasurelicious
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback