Hi, I’m struggling with something and it works in one place, not another.
Given this JSON:
{
"data":[
{
"type":"image",
"item":{
"link":"linkitem",
"url":"www.x.com",
"summary":"descriptiontext"
}
},
{
"type":"image",
"item":{
"link":"linkitem2",
"url":"www.y.com",
"summary":"description text 2"
}
}
]
}
And the code of:
{{ $dataJ := getJSON (printf "http://matmatthews.000webhostapp.com/parseXml.php") }}
{{ range first 8 (where $dataJ.data ".type" "eq" "image") }}
<li>{{ .image.summary }}<li>
{{ end }}
Why does it not work? I’ve matched another JSON file and used the same code. I just don’t get it. Any pointers would be good.