On Aug 19, 3:49 pm, xavier <[EMAIL PROTECTED]> wrote:
> Have you seen this post ? Thats going in the same direction I think,
> and I like the idea of being able to use the template for an array.
>
> Otherwise, a more complete, non jquery based one
> http://code.google.com/p/trimpath/wiki/JavaScriptTemplates

Xavier, been looking at this non jQuery trimpath template processor.
Whats interesting is that is also has conditional template processing
like what we have on our server side WCT system.

WCT: Server Side

<table>
@if Products.Size = 0@
     <tr><td colspan="4">No products in your cart.</tr>
@else@
   @for 1 to  Products.Size@
   <tr>.....products fields....</tr>
   @next@
@endif@
</table>

TrimPath:  Client side

<table>
 {for p in products}
     <tr>... product fields></tr>
 {forelse}
     <tr><td colspan="4">No products in your cart.</tr>
 {/for}
</table>

Of course, trimpath is not jQuery ready.  I think Yahuda could easily
add some conditional template processing.  But it needs to add support
for JSON arrays because that is where it will only make most sense.
But I can see some simple conditional processing like when the JSON
data is empty.

Yahuda Template Plugin: (Client side)

<div class="_template" id="myTemplate">
 <![CDATA[
        {{if error}
        <p>Error with Data!</p>
        {{else}}
        <table>
         ..........
        </table>
        {{endif}}
  ]]>
</div>

or something like that. <g>

--
HLS



Reply via email to