bolle Hi, thatโs a pretty good question. At the moment it is only possible to you use plain PHP for arrays.
Assuming you have in your data.txt
a fruits
variable like:
fruits: apple, banana, lemon
Then you can use it like this in a PHP snippet in a separate snippets/fruits.php
file:
$Page = $Automad->Context->get();
$array = Parse::csv($Page->get('fruits'));
foreach ($array as $item) {
echo $item;
}
You can use that snippet then like this in your template:
<@ snippets/fruits.php @>
If you need an associative array you can put this into your data file:
fruits: {"apple": "green", "banana": "yello"}
And in your snippet file:
$Page = $Automad->Context->get();
$array = json_decode($Page->get('fruits'));
foreach ($array as $key => $value) {
...
}
All the examples are untested though. But maybe it can help you to make it work.