Hide
Search Results

Appendix B: YML Reference

yml:a

Deprecated

Creates a link to a different Open Application view, which can either be loaded in a new page view or DOM node.

Attributes

Name Type Required Description
view string No Name of application view linked to. The allowed values for application view are YahooFullView”.”
params string No Parameters that are passed to the linked view. For YahooFullView, the params string is appended to the URL. See URL Parameter Encoding and Relative Paths for details.
replace string No The ID of a DOM node that will be replaced with the output of the view or params specified. The entire node is replaced.
insert string No The ID of a DOM node where the contents will be substituted with the output of the view or params specified. Although the contents of the node are substituted, the node itself remains.

Note: Do not specify both replace and insert in the same element. If either of these attributes is used, the included content is filtered; specifically, JavaScript is removed and CSS is moved to the head of the document (where it can have global effects).

Examples

yml:audio

Creates an audio media player that plays MP3 files. The contents of the tag may define a playlist in an XML format.

Attributes

Name Type Required Description
src string required Full URL path to the MP3 file.
autostart boolean optional Sets the player to auto start on load. Default is ‘false’. Autostart is not available in a small view.
mute boolean optional Sets the volume to mute. Default is ‘false’.
volume string optional Defines the volume level. Default is ‘0.7’.
loop boolean optional Allows the audio track to loop. Default is ‘false’.
artist string optional Defines the artist name. Default is ‘Unknown Artist’.
title string optional Defines the track name. Default is ‘Unknown Track’.

Examples

<yml:audio src="http://www.yourdomain.com/file.mp3"
           title="My Car is Faster than Your Car"
           artist="Sammy Speedo" />

yml:customize

Creates a link to an installation screen for your app. Use in Preview content.

Attributes

None

Examples

<yml:customize>Click here to customize this app!</yml:customize>

yml:form

Creates a form that posts to a different Open Application view, which can either be loaded in a new page view or a DOM node. Any form controls inside the yml:form will be posted as params to the view.

Attributes

Name Type Required Description
view string optional Name of application view to link to. Allowed value is ‘YahooFullView’.
params string optional Parameters to pass to the view being linked to. The params string is appended to the URL. See URL Parameter Encoding and Relative Paths.
name string optional The name of the form.
method string optional The HTTP method, for example, POST.
replace string optional The ID of a DOM node that will be replaced with the output of the view or params specified. The entire node is replaced.
insert string optional The ID of a DOM node where the contents will be substituted with the output of the view or params specified. Although the contents of the node are substituted, the node itself remains.

Examples

<yml:form name="myform" params="add.php"  method="GET">
   <fieldset>
   Symbol:
   <input type="text" name="symbol"/>
   Shares:
   <input type="text" name="shares"/>
   <input type="hidden" name="user" value="<?php echo $profile->guid; ?>"/>
   </fieldset>
   <input type="submit" value="Buy" />
</yml:form>

yml:friend-selector

Displays an HTML select list of the user’s friends. In a Yahoo! Profile, friends are called “Connections.” Note: If the viewer (person running the application) and the target user (specified by uid attribute) are not the same, the friends list is available only if the viewer and the target user are friends.

Attributes

Name Type Required Description
uid string optional The ID of the user to build a friends list for. Allowed values are a GUID, the string viewer, and the string owner. Default is viewer.
multiple boolean optional Allows multiple selections. Default is false.
name string optional Name of the form element that is generated. Default is selectedFriend.
size numeric optional Size of HTML select element. If multiple is set, then this defaults to 10. Otherwise, it’s ignored.
selected string optional A comma-delimited list of user IDs (uid) that will be pre-selected. Default is nothing selected.

Examples

<yml:friend-selector uid="viewer"/>

<yml:friend-selector uid="PQ12345"/>

<yml:friend-selector uid="viewer"
                     multiple="true"
                     selected="PQ12345,AF34291,XP2qaAf3,owner"/>

yml:if-env

Includes content or blocks of application code dynamically, based on the user’s browser, version, operating system, or if the browser is considered A-grade <http://yuilibrary.com/yui/environments/>_ by Yahoo!.

Attributes

Name Type Required Description
ua string optional Specifies the browser user agent. Allowed values: firefox, safari, ie, opera.
minver string optional Shows the content if the user’s browser version is at least the given value.
maxver string optional Shows the content if the user’s browser version is at most the given value.
os string optional Specifies the user’s operating system. Allowed values: macosx, winvista, winxp, win2000.
view string optional Specifies the current view being displayed.
agrade boolean optional Specifies that the browser and operating system must be an A-grade <http://yuilibrary.com/yui/environments/>_ browser.

Examples

<yml:if-env agrade ="true">You are browsing with an A-grade browser</yml:if-env>
<yml:if-env ua="firefox">You are browsing with Firefox</yml:if-env>
<yml:if-env ua="ie" minver="6">IE greater than or equal to version 6</yml:if-env>
<yml:if-env view="myview">Showing the "myview" view.</yml:if-env>

yml:include

Includes content from the specified source. This tag also allows an application to refresh data in the Small View periodically.

Content fetched by yml:include is filtered:

  • HTML markup is passed through without modification.
  • CSS is moved to the head of the document; it is never kept in the body. This means that styles in fetched content can affect the document globally.
  • JavaScript is always removed.

Attributes

Name Type Required Description
params string required The relative path to the content, including any required parameters. See URL Parameter Encoding and Relative Paths.
replace string optional The ID of the DOM node to replace with the output specified by the params attribute. The entire node is replaced.
insert string optional The ID of a DOM node whose contents will be replaced with the output specified by the params attribute. Only the node’s contents are replaced.
delay integer optional The number of milliseconds to wait before YAP gets the content specified by the params attribute. The content will not be loaded any sooner than the number of milliseconds specified. The default value is 0. The yml:include tag allows a maximum of five requests to run concurrently. If a page has more than five yml:include tags, and if these tags do not specify a delay, then an 400 error will occur. To avoid this error, specify the delay attribute to group the requests, as shown by the second yml:include example below. The delay attribute is not a strict contract. The YAP engine guarantees that the new content will not be loaded any sooner than the number of milliseconds specified by the delay attribute. However, it may take several seconds longer, depending on several factors. For example, if the value of delay is 5000, the new content may be inserted anywhere from 5 to 10 seconds after the content is loaded.

Note: Specify either replace or insert, but not both. Earlier implementations allowed yml:include elements with neither replace nor insert attributes, but this usage is deprecated.

yml:message

Deprecated

Creates a form that opens a message dialog for the user. With the dialog, the user can send a message to Yahoo! Connections (friends) or other users to tell them about the application. Those connections and users receiving the message will get the message in the form of an email and a notification.

The message element contains HTML form controls, each of which must have one of the following names (e.g. <input name=”subject” ...>):

Name Use
to GUID(s) of message recipient(s)
subject subject of message
body content of message
image image that appears with message
link_href target of link that appears with message
link_label link text of link that appears with message
submit label of ‘Submit’ button in dialog that sender sees (defaults to ‘Send’)

Attributes

Name Type Required Description
view string optional Name of application view, for example, YahooFullView.
params string optional Path to a program, relative to the application containing the yml:message tag. (See URL Parameter Encoding and Relative Paths.) The DOM node specified by the insert or replace attribute is inserted into or replaced by the output of the program specified by the params attribute.
replace string optional The ID of a DOM node to replace with the output of the params specified.
insert string optional The ID of a DOM node whose contents will be replaced with the output of the params specified.

Examples

The yml:message and div tags in the following listing are in the code of the Canvas View (YahooFullView). When the yml:message tag is executed, a form in a message dialog appears to the user. The message dialog is pre-populated with the form controls to, subject, and body, which the user can modify. The value of the to control is the GUID of a Yahoo! user. (You can specify multiple GUIDs, separated by commas.) In the message dialog, the “To” field contains the display name of the recipient. When the user clicks the submit button, an email is sent to the user specified by the to form control. The output of myprog.php is inserted into the DOM node of the div with the ID sect1, replacing the contents of the div.

In Yahoo! Mail, the message appears as an email in the recipient’s inbox. The text in the email’s subject and body correspond to the values specified by the form controls in the yml:message tag. The email contains three other elements: an “Add” button, an image, and a link. By clicking the “Add” button, the recipient can install the application run by the sending user (that is, the application containing the yml:message tag). The image in the email is specified by the image form control of the yml:message tag. The link in the email is labelled “Click me”, as specified by the link_label form control. The destination of the link is click_from_email.php, as indicated by link_href.

. . .

<yml:message

   view="YahooFullView"
   params="myprog.php"
   insert="sect1">

   <!-- GUID of the Yahoo Connection who is the message recipient. -->
   <input name="to" type="hidden" value="MHT5XY4FBG2OXXHQYWVPOF4A2E">

   <!-- Subject of message. -->
   <input type="text" name="subject" value="an app you will like">

   <!-- Body of message. -->
   <textarea name="body">This is a really funny app.</textarea>

   <!-- Image for message that appears to the recipient. -->
   <input type="text" name="image" value="http://host.domain/pic.jpg">

   <!-- Target of link that appears to the recipient. -->
   <input type="hidden" name="link_href" value="click_from_email.php">

   <!-- Label of link that appears to the recipient. -->
   <input type="hidden" name="link_label" value="Click me">

   <!-- Label of submit button in message dialog that appears to sender. -->
   <input type="submit" name="submit" value="Send message now">

</yml:message>

. . .
<div id="sect1">
  <p>This paragraph is replaced by the output of myprog.php.</p>
</div>
. . .

yml:name

Displays the name of the specified person. Optionally, links to the person’s Yahoo! Profile page.

Attributes

Name Type Required Description
linked boolean optional If true, the name displayed links to the Yahoo! Profile page of the user. Default is ‘false’.
useyou boolean optional Display the word ‘you’ instead of the user’s actual name if the user is the viewer. Default is ‘false’.
reflexive boolean optional Used in conjunction with the useyou=’true` attribute. If true, shows ‘yourself’ instead of ‘you’. Default is false.
capitalize boolean optional If true, capitalizes the first letter of the user’s name. Default is false.
uid string optional The ID of the user whose name is displayed. Allowed values are a GUID, viewer, and owner. Default is viewer.

Examples

<yml:name uid="viewer" linked="true" capitalize="true" />

<yml:name uid="QPR12345" />

yml:profile-pic

Displays the user’s Yahoo! Profile picture. Optionally, links to the user’s Yahoo! Profile page.

Attributes

Name Type Required Description
linked boolean optional If true, the picture displayed links to the user’s Yahoo! Profile page. Default: false.
width int optional The width and height in pixels of the picture. The maximum size is 48. Default: 48.
uid string optional The ID of the user whose picture is to be displayed. Allowed values are a specific user ID, the string ‘viewer’, and the string ‘owner’. Default: ‘viewer’.

Examples

<yml:profile-pic uid="viewer" width="48" linked="false" />

<yml:profile-pic uid="PA385037" width="24" linked="true" />

<yml:profile-pic uid="owner" width="48" linked="true" />

yml:pronoun

Displays a pronoun appropriate for the user ID and specified parameters. Note: Only define one of the tense-related attributes (possessive, reflexive, objective) at a time. If more than one is specified, one will take precedence over the rest.

Attributes

Name Type Required Description
uid string required User ID of the pronoun to render. Allowed values include an ID, the string ‘viewer’, and the string ‘owner’.
useyou boolean optional Display ‘you’ instead of a personal pronoun. Default is ‘true’. Only applicable when uid=’viewer’.
possessive boolean optional Display the possessive form of the pronoun (your, her, his, their). Default is ‘false’.
reflexive boolean optional Display the reflexive form of the pronoun (yourself, himself, herself, themselves). Default is ‘false’.
objective boolean optional Display the objective form of the pronoun (you, her, him, them). Default is ‘false’.
usethey boolean optional Display they” if the gender cannot be determined. Default is ‘true’.”
capitalize boolean optional Capitalize the first letter of the pronoun. Default is ‘false’.

Examples

<yml:pronoun uid="viewer" useyou="true"/>
<yml:pronoun uid="viewer" useyou="true" capitalize="true"/>
<yml:pronoun uid="12345" possessive="true"/>
<yml:pronoun uid="viewer" obj="true"/>
<yml:pronoun uid="viewer" reflexive="true" capitalize="true"/>
<yml:pronoun uid="owner"/>
<yml:pronoun uid="viewer" usethey="true"/>

yml:share

Deprecated

Creates a form that will open a “message” dialog for the user. It’s just like yml:message, except that the message itself is not customizable, and you cannot specify a view where the user will “land” when they’ve sent the message. Also, the user has two allotments of messages that they can send per day: one for generic messages and another for sharing messages. Users receiving the message will get the message in the form of an email and a notification.

Attributes

None.

Examples

<yml:share>
     <!-- this is a list of guids, or just one guid -->
     <yml:friend-selector name="to" multiple="true" size="10" />
     <input type="submit" value="Share with your friends!">
</yml:share>

yml:swf

Includes a Shockware Flash (SWF) object in an Open Application.

Note: Caja imposes security restrictions on the use of Flash code.

Attributes

Name Type Required Description
src string required The full path URL to the SWF file.
width int required The width of the SWF object in pixels.
height int required The height of the SWF object in pixels.
play boolean optional Autoplay when the SWF loads. Default is ‘true’.
loop boolean optional Play the SWF continuously. Default is ‘false’.
menu boolean optional Display a context menu when the user right-clicks the SWF object. Default is ‘false’.
quality string optional Quality of the object. Allowed values: ‘high’, ‘medium’, ‘low’. Default is ‘high’.
scale string optional Scaling of the SWF object. Allowed values: ‘showall’, ‘noborder’, ‘exactfit’, and ‘default’. Default is ‘default’.
align string optional Alignment of the SWF object within the DOM object. Default is null.
salign string optional Alignment of the SWF movie within the SWF object. Allowed values: ‘t’ (top), ‘b’ (bottom), ‘l’ (left), ‘r’ (right). Also allowed are the following combinations: ‘tl’, ‘tr’, ‘bl’, ‘br’. Default is ‘tl’.
wmode string optional Opacity setting. Allowed values: ‘transparent’, ‘opaque’, ‘window’. Default is ‘transparent’.
bgcolor string optional Hexadecimal SWF background color. Default is ‘#FFFFFF’.
flashvars string optional Developer-supplied flashvars. The values must be HTML encoded. Default is null.

Tag Contents

If the user does not have a high enough version of Flash, they’ll see the contents of the tag. If you don’t put anything here, then they’ll see a default message with a link to download the latest version of Flash.

If play is not set to “true”, then the user will have to click the fallback content to activate the Flash movie.

Examples

<yml:swf src="http://example.com/app.swf" width="780" height="1000"/>

<yml:swf src="http://example.com/app.swf" height="780"
                                          width="1000"
                                          flashvars="foo=bar"/>

yml:user-badge

Displays the user badge, which is the name and picture of the user’s Yahoo! Profile. Optionally, links to the person’s Yahoo! Profile page.

Attributes

Name Type Required Description
linked boolean optional If true, the badge displayed links to the user’s Yahoo! Profile page. Default is ‘true’.
width string (numerical) optional The width in pixels of the badge with a max of 48. Default is ‘48.
reflexive boolean optional If true, shows ‘yourself’ if useyou=’true’, otherwise it’s ignored. Default is ‘false.
capitalize boolean optional If true, capitalize the first letter of the user’s name. Default is ‘true’.
useyou boolean optional If true, and the user is the viewer, it’ll show you” instead of the name. Default is ‘false’.”
uid string optional The ID of the user whose badge is displayed. Allowed values are ‘viewer’, ‘owner’, or ‘id’. Default is ‘viewer’.

Examples

<yml:user-badge uid="viewer"
                linked="true"
                width="48"
                reflexive="false"
                useyou="false"
                capitalize="true" />

Table of Contents