Skip to content

Kirby 3.7.5

video

A Youtube or Vimeo video embed

Preview

Default files

Snippet

<?php
use Kirby\Cms\Html;

/** @var \Kirby\Cms\Block $block */
?>
<?php if ($video = Html::video($block->url())): ?>
<figure>
  <?= $video ?>
  <?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/main/panel/src/components/Forms/Blocks/Types/Video.vue