Kirby 2. I have subpages with a load of data.
projects/project-5/, I have a field in the blue print called
days to complete, on the home page I want to collate all the
days to complete under every project page and show a total of
days complete, how would I go about displaying it?
There’s nothing to calculate if you want to show it under every project?
For a total of all fields of all subpages, you can pluck all values into an array and get the total
$completeDays = page('projects')->children()->pluck('days_to_complete', ',', false);
Yes that’s it, sorry I didn’t explain that part well but thank you for that answer. I did look at pluck but wasn’t sure how to put it into practice, thanks so much
My apologies, can I just double check something, the result is coming back with
Array 0, even though the data is present, what’d be the reason?
Hm, what do you get if you do a
Or what does the
days_to_complete field contain? I was expecting it to contain a number.
My mistake with a spelling error, all fixed now thank you for your patience.