That’s what I was thinking conceptually but I have trouble with the correct code/syntax. For now I am trying another, simpler approach that doesn’t involve the above mentioned repo or JSON. I am now just working with the Kirby API.
These are the approaches I’ve tried to far (based on the same blueprint as above).
Using pluck() (which might not be right because I will then have to loop through these dates?):
<?php foreach($page->children()->listed()->toPages()->terminitemtermine()->toStructure()->pluck('termindate') as $date): ?>
<?= $date ?>
<?php endforeach ?>
Using collections:
site/collections/termindates.php
<?php
return function ($site) {
return $site->find('termine')->children()->listed()->toPages()->terminitemtermine()->toStructure()->termindate();
};
In the snippet
<?php foreach($kirby->collection('termindates') as $date) {
echo $date->html();
} ?>
Also tried something along the lines of this post: Getting specific page children structure field - #6 by ryuchix
But no luck so far. It mostly tells me “Call to a member function terminitemtermine() on null”. How do I get into the children pages? What am I missing?