Changes between Version 21 and Version 22 of hi5TemplateLibraryDocumentation

Show
Ignore:
Timestamp:
07/21/08 16:10:05 (16 months ago)
Author:
me.yahoo.com/siruguri#82788 (IP: 10.100.10.112)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • hi5TemplateLibraryDocumentation

    v21 v22  
    77<ol> 
    88<li><a href="#Overview">Overview</a></li> 
    9 <li><a href="#HowTo">How to add templates to your code</a></li> 
    10 <li><a href="#Down">Downloading the library</a></li> 
     9<li><a href="#HowToAddTemplatesToYourCode">How to add templates to your code</a></li> 
     10<li><a href="#DownloadingTheLibrary">Downloading the library</a></li> 
    1111<li><a href="#hi5.templateTags">hi5 Template Tags</a></li> 
    1212<li><a href="#hi5.templateFunctions">hi5 Template Functions</a></li> 
     
    1717}}} 
    1818== Overview == 
    19 The hi5.template library is a browser side, Javascript library which enables you to fuse Javascript data and logic into your HTML. It simplifies writing localized apps by providing a message resource tag, <os:message key=”resource” />, which eliminates the need to build messages and HTML with Javascript. To ease transitioning to language resource files, you can provide the message resource directly in the message tag.  For example: <os:message key=”received_gift” gift=”pizza” friend=”Joe”>You received a ${gift} from ${friend}</os:message>.  Also, using the hi5.template library allow future compatibility with our user generated content inline-translation tool.  
     19The hi5.template library is a browser side, Javascript library which enables you to fuse Javascript data and logic into your HTML. It simplifies writing localized apps by providing a message resource tag, <os:message key=”resource” />, which eliminates the need to build messages and HTML with Javascript. To ease transitioning to language resource files, you can provide the message resource directly in the message tag.  For example: <os:message key=”received_gift” gift=”pizza” friend=”Joe”>You received a ${gift} from ${friend}</os:message>.  Also, using the hi5.template library allow future compatibility with our user generated content inline-translation tool. 
    2020 
    2121The template is straightforward, with only a few conventions: ${} for variable substitution, <for-each> for iteration, <if>/<else> for conditional logic, and <!os:message> for gadget resource localization.  There is also a <set> tag for storing the output of tags, and <!os:name> and <!os:profile-pic> convenience tags.[[BR]][[BR]]The library is based on XML templates, which can be embedded in `<script type="text/xml">` tags or loaded remotely with `gadgets.io.makeRequest()`.  Here's an example which iterates over an array of friends and displays their thumbnail photo:[[BR]][[BR]]'''application.xmlt'''[[BR]][[BR]]`<stylesheet xmlns:os="http://www.w3.org/1999/xhtml"> ` 
     
    4444 
    4545---- 
    46 == How To Add Templates To Your Code === 
     46== How To Add Templates To Your Code == 
     47Here’s an example of where you would put the library in your application XML:   <Content type="html" quirks="false" view="default"><![CDATA[ 
    4748 
    48   
    49 Here’s an example of where you would put the library in your application XML: 
    50   
    51 <Content type="html" quirks="false" view="default"><![CDATA[ 
    52             <link rel="stylesheet" type="text/css" href="http://www.company.com/app/application.css"> 
    53             <div id="page-content"></div> 
    54             <script type="text/javascript" src="http://www.company.com/hi5_template_20080430.js"></script> 
    55             <script type="text/javascript" src="http://www.company.com/app/application.js"></script> 
     49  <link rel="stylesheet" type="text/css" href="http://www.company.com/app/application.css"> <div id="page-content"></div> <script type="text/javascript" src="http://www.company.com/hi5_template_20080430.js"></script> <script type="text/javascript" src="http://www.company.com/app/application.js"></script> 
     50 
    5651</Content> 
    5752 
    58 == Downloading The Library === 
    59  
    60 Here’s the zip file with library and documentation: 
    61   
    62 http://static.hi5.com/images/opensocial/hi5_template_20080430.zip 
     53== Downloading The Library == 
     54Here’s the zip file with library and documentation:   http://static.hi5.com/images/opensocial/hi5_template_20080430.zip 
    6355 
    6456== hi5.template Tags == 
Close