Everything works great, but now I would like to use the selected pages to output there data.
I use kirby headless, and when I do $page->filters() it returns "value":"- 'page://JSbhooZBUnKD5YOn'\n- 'page://MlM0QADBzmcZltsM'\n- 'page://BzAzENuWPvJ0C9qf'\n- 'page://FJ5sXLcImFgmuHHu'"
However, when i try $page->filters()->toPages() to later use a map function to access the data, I get a “Call to a member function children() on array” error. How am I supposed to access the data of the pages field?
I narrowed the problem down a bit. I hope I can explain it because it has something to do with my specific file structure.
I have a couple of pages where the filters field is used.
When calling 'filters' => $page->filters()->toPages() on one of the pages, it does indeed provide the right results, e.g. output like this: