<Require feature="..."/>To use OSML tags, you need to add the "osml" feature to your gadget spec: <Require feature="osml">OSML tags are a strict subset of OpenSocial Templating, you can also use tags if you use the "opensocial-templates" feature: <Require feature="opensocial-templates">The reason for separate require features is that templates may not be supported on all views for all containers, due to processing and/or latency costs. OSML tags must be supported in all views. Initial Tag Set<os:Name>Inline tag to show a person's name, linked if the a profile URL an may have additional container bling (i.e. more information on hover) Attributes: @person {string|Object} The person object or DataContext key referring to a person object. (required)Examples: Welcome, <os:Name person="${Viewer}"/><os:PeopleSelector>Tag to show a UI that chooses from a list of people, and set a form field with the associated value. Attributes: @group {string|Object} An array of person objects or DataContext key referring to an array of person objects.Examples: <form action="/top_friends.php" method="POST"> <os:Badge>Block level tag to show information about a person in the style of the container, usually with an image. Attributes: @person {string|Object} The person object or DataContext key referring toExamples: My top friends:<br/> <os:Get>Tag that loads HTML content from a URL and inserts into the DOM of the page.
Attributes: @href {string} The URL from which to retrieve HTML content (required)Examples: ${Viewer.Name}'s pet informationNon-TagsThere are a number of potential tags that can be better supported using templating, for reasons outlined below. Non-tag: Inserting Text ContentFor generating text content, expressions are used instead of tags. Example:
Reasoning:
Non-tag: Flow ControlFor conditional content, a conditional statement in OpenSocial templating is used along with an expression. Example:
instead of
Reasoning:
Non-tag: PronounFor pronouns, conditional HTML blocks based on gender are used. Example:
Reasoning:
Interaction with Proxied ContentThe combination of tags, templates, and proxied content leads to a number of combinations for developer to use. Here are a few common use cases and how developers might handle them. This is for informational purposes only - it doesn't extend the proposal, but hopefully clarifies a few use cases. Flow control and repeated elementsOpenSocial data will be posted on the developer server and flow control will be handled on the developers own server, in PHP, JSP, ASP, or the language of the developer's choice. Example Gadget XML: <Content href="http://developer.com/canvas"> Example PHP: <?php TagsTags can be inserted into the output and will be processed by the container or JavaScript on the client side. Example Gadget XML: <Content href="http://developer.com/canvas"> Example PHP: <?php |