Video block doesn't show up


      label: Filmtitel
      type: text
      type: blocks
          type: group
            #  - image
              - video
        label: Beschreibung
        type: text


    <h2><?= $page->titel()->html() ?></h2>
        <?= $page->videos()->toBlocks() ?>
    <p><?= $page->description()->html() ?></p>

The title field and the description render just fine, but the video embed doesn’t.

I actually just need a simple video field for youTubes and Vimeos, but I couldn’t find one in the docs, so I took a block with just a video block.

That is because videos is a native Kirby method ($page->videos() | Kirby CMS).

See also naming fields: Fields | Kirby CMS

You can get the field via

<?= $page->content()->get('videos')->toBlocks() ?>

Or rename your field to something else.

Yes, it was the field name. I thought the forbidden name was “video”.

But still, what is the blueprint field type for video if it isn’t a block? Can I only have a blocks field to have a video field? I couldn’t find it in the docs.

You would use a files field and limit what type of files can be uploded via a file blueprint (using the accept option (if you want to use a video file).

If you only want to use a video url, you can use a url field, that’s what’s used in the video block as well. There is no video field type.

Maybe there should be one?

A video embed isn’t really a file that you upload to a site, thats why I thought that would be the wrong way to do it. The files field I think of as something to upload and then present it to the user like an image or for downloading it like a PDF, but a video embed feels different to me. But maybe that’s really just me.

I didn’t say you should upload a video. As I said, use a url field to put your video url into.

This is the video block blueprint:

icon: video
preview: video
    type: url
    type: writer
    inline: true

It uses a url field as well.

If you want, you can add a validator to the field that checks for youtube/vimeo urls.

Äh… right.

PS: That video blocks blueprint I got from the starter kit that I used this time.