There's no if -- you can only test based on the truth of keys (using
.section).  The idea in JSON Template is that "logic" goes in your
code.  Templates are just for presentation, so the logic you can do is
minimal.

That said, I was thinking about adding predicates, which should solve
this, but so far haven't had the time.  There are a few threads about
them.

Andy

On Mon, Sep 14, 2009 at 4:55 PM, Steven Roussey <[email protected]> wrote:
>
> How to do an if statement?
>
> {.section foo=='bar'}
>
>    some stuff {a:html}
>    other junk {b:html}
>
> {.end}
>
>
> {.section foo=='barbara'}
>
>    more stuff {c:html}
>    complete junk {v:html}
>    lots of other jojo
>
> {.end}
>
> The above doesn't work... how should it be done?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON 
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to