Hi all, Im probably asking a dumb question. But i can’t figure it out.
I want to loop though the ‘drafts’ pages, but i get nothing, hope anyone can give me a quick hint!
all i get is below, but cant loop through them…
object(Kirby\Cms\Pages)#252 (0) { } object(Kirby\Cms\Pages)#266 (0) { } object(Kirby\Cms\Pages)#285 (0) { } object(Kirby\Cms\Pages)#290 (0) { } object(Kirby\Cms\Pages)#294 (0) { } object(Kirby\Cms\Pages)#299 (0) { } object(Kirby\Cms\Pages)#305 (0) { } object(Kirby\Cms\Pages)#310 (0) { }
$draftpages = $pages->drafts();
var_dump($draftpages);
foreach ($draftpages as $item):
var_dump($item->title());
endforeach;