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?