Get Actual Page Object from Checkbox/Select

I’m trying to use a checkbox field populated with a query of published children like so:

      checkbox:
        label: Featured Projects
        help: Select projects to feature on the homepage. To choose episodes for each project, visit the project page itself. 
        min: 1
        max: 5
        type: checkboxes
        options: query
        query: 
          fetch: page.children.published
          text: "{{ page.title }}"
          value: "{{ page }}"

While it is pulling the string that I want, I actually am trying to use the checkbox to select pages to then feature on the homepage like so:

<figure class="main-carousel" id="<?= $page->uid() ?>">
<?php foreach ($center->checkbox()->split() as $project): ?>
  <li><?=  $project->text() ?></li>
<?php endforeach ?>
</figure>

however, I keep getting the error Call to a member function text() on string which leads me to believe that the checkbox field is converting into a string.

Would there be any way to pull the actual page itself from the checkbox? or is there a field better suited to that?

Or would I then have to use this string and findBy to get the actual page?

Because $project is only a string. What you want to do is create a collection of pages from what is stored in your field.

Additionally, what is text() supposed to be, a field in your projects?

$projects = $center->checkbox()->toPages(',');
foreach ( $projects as $project) 
  // do stuff
}

However, for this to work you have to store the page.id as value not page.

Will try this out in a second!

And as for text, that was just a placeholder to chose what returns an error.

This whole structure goes one level deeper so I’m actually going to use this to return one more page object and from there pull an image or video

I added a comma I forgot to the toPages() method.

so my field should look like this?

        query: 
          fetch: page.children.published
          text: "{{ page.title }}"
          value: "{{ page.id }}"

As of right now, i’m just getting blanks with the code.

Wait that was my fault. The panel depopulated the field. It’s working now!