Welcome, GuestSign In
Yahoo! Store Manage My Services
Merchant Resources > Store Guide > Advanced Features > RTML Reference > Conditionals
Merchant Resources
Updates
  System Status
  Merchant Newsletter
Learn More
  Getting Started Guide
  Guides and Resources
  Store Help
 
Related Services
 Designer Directory
  Yahoo! Shopping
Partners
  UPS
  GotMarketing
  Commission Junction
  Paymentech
  Marketing Partners
 
Conditionals

A conditional is an expression that can do different things depending on the value of some test. Here is a template that will insert a linebreak between two images if the width of the first is greater than 200 pixels:

Max200 ()
TITLE "No wider than 200"
BODY
  WITH= variable im
        value RENDER text "Hello"
                     font-size 25
    IMAGE source im
    IF test > value1 WIDTH im
              value2 200
       then LINEBREAK
       else SHIM width 10
    IMAGE source RENDER text "World!"  
                        font-size 25
The IF operator takes three arguments. If the test argument is true, the then argument is evaluated; otherwise the else argument is evaluated.

In this case, if the width of im is greater than 200 then a linebreak will be generated; otherwise a 10-pixel wide shim will be generated.

The SHIM operator generates a transparent image of a specified height and/or width. Such images are useful in controlling the spacing of elements on the page.