Skip to content

Kirby 3.5.7.1

video

A Youtube or Vimeo video embed

Preview

Default files

Snippet

<?php /** @var \Kirby\Cms\Block $block */ ?>
<?php if ($block->url()->isNotEmpty()): ?>
<figure>
  <?= video($block->url()) ?>
  <?php if ($block->caption()->isNotEmpty()): ?>
  <figcaption><?= $block->caption() ?></figcaption>
  <?php endif ?>
</figure>
<?php endif ?>

To overwrite this default snippet, place your custom file in /site/snippets/blocks/video.php.

Blueprint

name: field.blocks.video.name
icon: video
preview: video
fields:
  url:
    label: field.blocks.video.url.label
    type: url
    placeholder: field.blocks.video.url.placeholder
  caption:
    label: field.blocks.video.caption
    type: writer
    inline: true

To overwrite this default blueprint, place your custom file in /site/blueprints/blocks/video.yml.

Vue component

kirby/blob/master/panel/src/components/Blocks/Types/Video.vue