Last active
April 24, 2016 16:27
-
-
Save marczobec/f6c319b85b8cd24ea6ca to your computer and use it in GitHub Desktop.
Extension for Kirby's kirbytext. Embed vine posts in your content with a tag. For more information about Kirby visit http://getkirby.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
kirbytext::$tags['vine'] = array( | |
'attr' => array( | |
'size' | |
), | |
'html' => function($tag) { | |
$vineURL = $tag->attr('vine'); | |
$size = $tag->attr('size', '300'); | |
return '<iframe src="' . $vineURL . '/' . 'embed/simple" width="' . $size . '" height="' . $size . '" frameborder="0" class="vine-embed"></iframe><script async src="https://platform.vine.co/static/scripts/embed.js"></script>'; | |
} | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
Insert 'vine.php' at:
your_kirby_folder/site/tags/vine.php
Embed your vine posts with:
(vine: https://vine.co/v/O3m90adUjdb)
You can also specify the size of the embed (defaults to 300, Vine's options are 600px, 480px and 300px):
(vine: https://vine.co/v/O3m90adUjdb size: 600)