Thank you for the reply I know the way I saw him, but I do not receive that what I need…
I have the array in JSON format:
[
{
"id": 0,
"type": "Type Zero",
"date": "2020-02-22",
"phone": 380001000000,
"images": ""
},
{
"id": 1,
"type": "Type One",
"date": "2020-04-24",
"phone": 380001000000,
"images": ""
},
{
"id": 2,
"type": "Type Two",
"date": "2020-07-08",
"phone": 380002000000,
"images": ""
}
]
{%- assign model = site.data.models | map: "phone" | uniq -%}
I get: Liquid Exception: no implicit conversion of String into Integer in
… hints at “phone”, but is not problem i changed it to…
[
{
"id": 0,
"type": "Type Zero",
"date": "2020-02-22",
"phone": "380001000000",
"images": ""
},
{
"id": 1,
"type": "Type One",
"date": "2020-04-24",
"phone": "380001000000",
"images": ""
},
{
"id": 2,
"type": "Type Two",
"date": "2020-07-08",
"phone": "380002000000",
"images": ""
}
]
{%- assign model = site.data.models | map: "phone" | uniq -%}
<ul>
{%- for too in model -%}
<li>{{ too.id }} / {{ too.type }} / {{ too.data }} / {{ too.phone }} / {{ too.images }}</li>
{%- endfor -%}
</ul>
…in the array model
i expected get
[
{
"id": 0,
"type": "Type Zero",
"date": "2020-02-22",
"phone": "380001000000",
"images": ""
},
{
"id": 2,
"type": "Type Two",
"date": "2020-07-08",
"phone": "380002000000",
"images": ""
}
]
<ul>
<li> 0 / Type Zero / 2020-02-22 / 380001000000 / </li>
<li> 1 / Type Two / 2020-07-08 / 380002000000 / </li>
</ul>
but in the array model
i get nothing if exactly I see
Now I see only one field “phone” i do not understand where other fields…?
<ul>
<li> / / / 380001000000 / </li>
<li> / / / 380002000000 / </li>
</ul>
Why? Did I miss something?