Merchant Solutions Integrations: RTML Version 1
RTML is the programming language that powers the building of pages in the Yahoo! Store Editor. Every object (e.g. an item or section) has an RTML template that describes what that object or page should look like. An RTML template yields ordinary HTML as its output, but with RTML you can describe complex pages that would be impossibly burdensome to express directly in HTML, either by hand or with a WYSIWYG authoring tool.
This page contains an alphabetical reference to all the available RTML operators. For more information about RTML, see the RTML Help Page on the Yahoo! Merchant Solutions web site.
RTML Operator Reference
The following table shows the RTML operators and provides a description of the function the operator performs.
| Operator | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| < | Returns true if the first argument is less than the second. Both must be numbers. | ||||||||
| <= | Returns true if the first argument is less than or equal to the second. Both must be numbers. | ||||||||
| > | Returns true if the first argument is greater than the second. Both must be numbers. | ||||||||
| >= | Returns true if the first argument is greater than or equal to the second. Both must be numbers. | ||||||||
| ACTION | Returns a url that will perform a certain action. The possible arguments are :email, :help, :request, :search, and :show-order. | ||||||||
| AND | Takes any number of arguments. If all return true, returns the value of the last. | ||||||||
| AS-LIST | Inserts begin and end list tags into the current page, either ol or ul depending on whether type is :ordered or :unordered respectively. See item. | ||||||||
| BASKET | Displays the visitor's shopping basket. | ||||||||
| BLUE | Returns a number between 0 and 255 representing the blue component of a color. | ||||||||
| BODY | Inserts html begin and end body tags into the current page. The arguments correspond to those of the tag. | ||||||||
| CALL | Calls another template, returning whatever value it returns, and inserting its output into the current page. | ||||||||
| CAPS | Takes a string and returns another string with the same letters in all caps. | ||||||||
| CENTER | Inserts html begin and end center tags. | ||||||||
| COLOGO | Returns an image representing the logo of the company providing this software, height pixels high. | ||||||||
| COLOR | Returns the color whose red, green and blue components are red, green,
and blue respectively. These arguments should be integers between 0 and
255. For example,
|
||||||||
| COMMENT | Inserts an html comment tag into the current page, containing the string given as the text. | ||||||||
| ELEMENT | Returns the element that occurs at position position in the sequence
sequence. (Strings and lists are sequences.) Numbering starts at 0. For
example
|
||||||||
| ELEMENTS | Returns a subsequence of the same type as sequence, consisting of
its first through last elements. For example,
|
||||||||
| EQUALS | Returns true if the first argument is the same as the second. Numbers are the same if their difference is zero. Symbols are the same if they are identical. Sequences are the same if each of their elements are the same. | ||||||||
| EVEN | Returns true if its argument is an even integer. | ||||||||
| FIND-ONE | Evaluates the expressions within the find-one expression with variable set to successive elements of sequence until the last expression returns true, whereupon that element is returned. Returns nil if no element causes the expressions to return true. | ||||||||
| FONT | Inserts html begin and end font tags into the current page. The arguments are the corresponding options to the font tag. | ||||||||
| FONT-WIDTH | Returns a number indicating how wide font is relative to Helvetica Bold. | ||||||||
| FOR | Used for iteration: variable is initially set to initial. Then test
(presumably an rtml expression referring to variable) is evaluated. If
it returns true, iteration stops. Otherwise the expressions within the
for expression are evaluated in order, then variable is set to update
(which can refer to variable), the test is evaluated, and so on. For example, to print the numbers from 1 to 10 on the current page, you would say:
|
||||||||
| FOR-EACH | Evaluates the expressions within the for-each expression with variable
set to successive elements of sequence. Returns a sequence of the same
type, whose elements are the values returned by the last expression on
each iteration. For example:
a b c |
||||||||
| FOR-EACH-BUT | Like for-each, but also evaluates last for every element of sequence except the last. | ||||||||
| FOR-EACH-OBJECT | Takes a list of ids of objects. (The contents field of an item or
section is always such a list.) For each one, the expressions within
the for-each are evaluated in order, with that object as the current
object. For example,
|
||||||||
| FORM | Inserts html begin and end form tags into the current page. The destination will be the action of the form. | ||||||||
| FUSE | Joins images (see render) on the axis specified by axis, aligned according
to align. The component images with be spacing pixels apart, with the
background-color showing through the gaps. The destination is currently
ignored. Can also be used to add a border around an image, by supplying just a background-color and margins. |
||||||||
| GRAB | Within a grab, what would be written to the current page is written to a string, which is returned. | ||||||||
| GRAYSCALE | Takes a color and returns a number between 0 (black) and 255 (white) representing the equivalent grayscale color. | ||||||||
| GREEN | Returns a number between 0 and 255 representing the green component of a color. | ||||||||
| HEAD | Inserts html begin and end head tags into the current page. | ||||||||
| HEIGHT | Returns a number representing the height of its argument, which should be an image. | ||||||||
| HEX-ENCODE | Returns a string of 2-digit hex numbers representing the ascii numbers of the characters in a string. | ||||||||
| HRULE | Inserts an html hr tag into the current page. The arguments correspond to the options of the hr tag. | ||||||||
| IF | The test expression is evaluated. If it returns true, the then expression is evaluated and its value is returned. Otherwise the else expression is evaluated and its value is returned. | ||||||||
| IMAGE | Inserts source, which must be an image into the current page. (Images are created by render and fuse.) The remaining arguments correspond to the options in the html img tag. | ||||||||
| IMAGE-REF | Returns a url that will point to image alone. | ||||||||
| INPUT | Inserts an html input tag into the current page. The arguments correspond to the tag options. | ||||||||
| ITEM | Inserts an html li tag in the current page. | ||||||||
| LENGTH | Returns a number representing the number of elements in sequence, which should be either a list or a string. | ||||||||
| LINEBREAK | Inserts number html br tags into the current page. The clear argument corresponds to the clear option of the br tag. | ||||||||
| LINES | Takes a string and returns a list of substrings representing each line of text in the original. | ||||||||
| LOCAL-LOGO | Obsolete. Use cologo instead. | ||||||||
| LOWERCASE | Takes a string and returns another string with the same letters in all lowercase. | ||||||||
| MAXIMUM | Returns the maximum of its arguments. | ||||||||
| META | Inserts an html meta tag into the current page. The arguments generate the corresponding options. Should only be called within a head expression. MINIMUM Returns the minimum of its arguments. | ||||||||
| MULTI | Used to clump several expressions together. The expressions within it are evaluated and the value of the last is returned. | ||||||||
| NOBREAK | Inserts html begin and end nobr tags into the current page. | ||||||||
| NONEMPTY | Returns true if string contains at least one non-whitespace character. | ||||||||
| NOT | Returns true if its argument is false, and vice versa. | ||||||||
| NUMBER | Inserts a representation of value into the current page, with digits digits after the decimal point. Uses for space characters if nb is T (default). | ||||||||
| OR | Returns true if any one of the expressions within it returns true. (None of the expressions after that are evaluated.) | ||||||||
| ORDER | Returns a url that will order the object whose id is object. | ||||||||
| ORDER-FORM | Inserts the shopping basket into the current page. | ||||||||
| PARAGRAPH | Inserts an html p tag into the current page. The align argument becomes the align option of the tag. | ||||||||
| PARAGRAPHS | Takes a string and returns a list of substrings representing each paragraph of text in the original. Paragraphs are blocks of text separated by blank lines. | ||||||||
| POSITION | Returns a number representing the position of element in sequence, or nil if it does not occur there. | ||||||||
| PRICE | Returns a string representing number as a price in the local currency. If supplied, currency overrides the local currency symbol. | ||||||||
| RED | Returns a number between 0 and 255 representing the red component of a color. | ||||||||
| RENDER | Creates an image. Usually used in one of two ways: to make an image
from a file supplied by the user, or to render text as a gif. To make an image from a file supplied by a user, supply an image argument of type image. (The image and icon fields in items are of type image.) The original image can be reduced by supplying max-width and max-height. To render text as a gif, supply a string as the text argument. You will probably also want to supply a font, a font-size, a background-color, a text-color, and margins. |
||||||||
| RETURN-WITH | Returns value immediately as the value of the call to the current template. | ||||||||
| SEARCH-FORM | Inserts a size-character wide search form into the current page. The form will be labelled label, and the search button will read button. | ||||||||
| SEGMENTS | Returns a sequence of successive length-element long subsequences of sequence. If the length of sequence is not a multiple of length, the last subsequence will be short. | ||||||||
| SELECT | Inserts an html select tag into the current page. The options will be the elements of the list options, with selected as the selected one. | ||||||||
| SHIM | Inserts a transparent image that is height high and width wide into the current document. The align argument corresponds to the align option of the html img tag. | ||||||||
| SHOPPING-BANNER | Inserts the shopping basket banner into the current page. Should be used only in .of files. | ||||||||
| SWITCH | Expressions within a switch expression are interpreted as alternating key-expression pairs. When a switch expression is evaluated, the value of value is matched against the keys, the corresponding expression is evaluated, and its value returned. Returns nil if no key matches. | ||||||||
| TABLE | Inserts html begin and end table tags into the current page. The arguments correspond to the tag options. | ||||||||
| TABLE-CELL | Inserts html begin and end td tags into the current page. The arguments correspond to the tag options. | ||||||||
| TABLE-ROW | Inserts html begin and end tr tags into the current page. The arguments correspond to the tag options. | ||||||||
| TAG-WHEN | Evaluates its body. If test is true, does so within tags indicated by tag. | ||||||||
| TEXT | Prints its argument on the current page. | ||||||||
| TEXT-STYLE | Inserts begin and end tags for one of the html text styles into the current page. The style can be :bold, :italic, :typewriter, :underline, :strike, :big, :small, :subscript, :superscript, or :blinking. | ||||||||
| TEXTAREA | Corresponds to the html textarea tag. | ||||||||
| TITLE | Inserts html begin and end title tags into the current page, with text as the title. Should only be called within head. | ||||||||
| TO | Returns a url that leads to the page of the object whose id is id. The id can be a symbol, or one of the variables id, up, prev, and next, which depend on the current context. | ||||||||
| TOKENS | Takes a string and returns a list of substrings representing each token in the original. Tokens are groups of characters separated by whitespace. | ||||||||
| VALUE | Intended for lookups more complex than @. Currently the only possible value for query is :local, which returns true or false depending on whether the object whose id is id has a local property prop. | ||||||||
| WHEN | If test returns true, the expressions within the when are evaluated and the value of the last is returned. Otherwise returns nil. | ||||||||
| WHOLE-CONTENTS | Returns a list of the ids of all unexiled objects, in some attempt at alphabetical order based on names. | ||||||||
| WIDTH | Returns a number representing the width of its argument, which should be an image returned by render. | ||||||||
| WITH-LINK | Inserts html begin and end a tags into the current page, with destination as the href. | ||||||||
| WITH-OBJECT | The expressions within the with-object will be evaluated in order with the object whose id is object as the current object. | ||||||||
| WITH= | The expressions within the with= expression will be evaluated with variable set to value. | ||||||||
| WORDBREAK | Inserts an html wbr tag into the current page. | ||||||||
| YANK | Returns a copy of sequence with all instances of element removed. | ||||||||
Ready to get started?
By applying for an Application ID for this service, you hereby agree to the Terms of Use
Yahoo! Groups Discussions
view all
Urgently Required Yahoo Store Developer / RTML Programmer
Wed, 17 Jun 2009
Re: Shopping API product URL's return empty results
Wed, 17 Jun 2009
Shopping API product URL's return empty results
Thu, 28 May 2009
How to transfer your existing web domain to a new web domain?
Sat, 07 Mar 2009

