Export to GitHub

kite - issue #3

Check if an array is existing in json


Posted on Jul 17, 2014 by Happy Ox

What steps will reproduce the problem? 1. Have a simple array in your JSON: "news": [ { "title": "Title 1", "date": "08:59:00", "url": "http://www.google.ch?news=1" }, { "title": "Title 2", "date": "07:00:00", "url": "http://www.google.ch?news=2" }, { "title": "Title 3", "date": "04:37:00", "url": "http://www.google.ch?news=3" } ]

  1. Then try to check in your Template if this is existing or not (Before the News you want to write "News"): {{?news}} News: {{#news}} - {{title}}<br> {{/news}} {{/?}}

  2. Do another check in the Template with {{?..}} It is not possible, because you would close two "{{/?}}"

I suppose, that multiple condition in each other should work. Do you have a workaround or fix date?

Thanks for your help.

Status: New

Labels:
Type-Defect Priority-Medium