Heya
I am using a MySQL setup for a list of videos.
I’ve setup everything (hopefully) according to the cookbook, but I can’t seem to get the draft
status working. It always shows unlisted
Any idea?
I’ll post all necessary code below:
# video.yml
title: Video
options:
changeSlug: false
changeTitle: false
fields:
status:
label: Status
type: text
disabled: true
#models/videos.php
class VideosPage extends Kirby\Cms\Page
{
public function children()
{
$videos = [];
foreach (Db::select('videos') as $video) {
$videos[] = [
'slug' => $video->slug(),
'num' => $video->status() === 'listed' ? 0 : null,
'template' => 'video',
'model' => 'video',
'content' => [
'title' => $video->title(),
(..)
'status' => is_null($video->status()) ? 'draft' : $video->status()
]
];
}
return Pages::factory($videos, $this);
}
}
even setting 'status' => 'draft'
does not change the panel preview
Functions in model/video.php
are per the cookbook.
Database has a column called status
and some entries with draft
in it
Any hint as to what I am missing?
Thanks!