Coder Social home page Coder Social logo

vyder / kirby-video-embed-block Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 62 KB

A Kirby v4 custom block type to upload and embed videos

License: MIT License

CSS 5.33% PHP 50.87% Vue 38.96% JavaScript 4.85%
kirby kirby-cms kirby-plugin kirby4 kirby4-plugin

kirby-video-embed-block's Introduction

Kirby Video Embed Block

I was surprised to find that the default Kirby v4 video block doesn't support a way to upload and embed a video - so here it is.

Preview of editing the video embed block's details

Install

There's a couple ways to install this plugin (and you can read more in Kirby docs here)

1. Download

Download this repo, and place its contents in /site/plugins/kirby-video-embed-block

2. Git

If you version control your project, you can add this plugin as a git submodule

❯ git submodule add [email protected]:vyder/kirby-video-embed-block.git site/plugins/kirby-video-embed-block

3. Kirby CLI

❯ kirby plugin:install https://github.com/vyder/kirby-video-embed-block.git

Usage

To add the ability to use VideoEmbed blocks in your page, you need to update the blueprint as follows:

fields:
    text:
        type: blocks
        fieldsets:
            - code
            - gallery
            - heading
            - image
            - line
            - list
            - markdown
            - quote
            - table
            - text
            - video
            - video-embed

So here, the text field is set as blocks, and specifies all the blocks available.

I would love if this plugin could just extend the default list of blocks in some way - but it doesn't seem possible as of now.

If this gets outdated, you can find the default list of kirby blocks here.

License

MIT

Contribute

Feel free to open issues if you think of features / encounter bugs - I'd be happy to take a look.

kirby-video-embed-block's People

Contributors

vyder avatar

Stargazers

Alex(k$ei) Mishakov avatar PixelSushiRobot avatar Enrico Lummitsch avatar

Watchers

 avatar  avatar

kirby-video-embed-block's Issues

Controls not working

In video-embed.php you need to fix line 9:

$controls = $block->showControls()->toBool() ? "controls" : "";

should be

$controls = $block->controls()->toBool() ? "controls" : "";

to get this option working :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.