Last active
December 29, 2015 14:49
Revisions
-
ian-cox renamed this gist
Nov 28, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ian-cox renamed this gist
Nov 28, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ian-cox revised this gist
Nov 28, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,8 @@ Use the kirbytag like this: (video: youtube.com/watch?v=0--NbrJX_xQ) (video: youtu.be/0--NbrJX_xQ) The embed code is wrapped in a div with a class called "Flexible-container". The coresponding CSS allows for fluid video embeds which scale to the width of the parent div. For more information on kirbytags, see the [Extending Kirbytext documentation](http://getkirby.com/blog/kirbytext). -
ian-cox revised this gist
Nov 28, 2013 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,17 @@ ## Vimeo/Youtube Kirbytext extension Place this php file in the site/plugins folder of your kirby install. The plugin strips the video id from the end of both Vimeo and Youtube links. Use the kirbytag like this: (video: vimeo.com/79338229) (video: youtube.com/watch?v=0--NbrJX_xQ) (video: youtu.be/0--NbrJX_xQ) The embed code is wrapped in a div with a class called "Flexible-container". The coresponding CSS allows for fluid video embeds which scale to the width of the parent div. For more information on kirbytags, see the [Extending Kirbytext documentation](http://getkirby.com/blog/kirbytext). -
ian-cox renamed this gist
Nov 28, 2013 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,10 @@ The plugin strips the video id from the end of both Vimeo and Youtube links. Use the kirby tag like this: (video: vimeo.com/79338229) (video: youtube.com/watch?v=0--NbrJX_xQ) (video: youtu.be/0--NbrJX_xQ) For more information see the [Extending Kirbytext documentation](http://getkirby.com/blog/kirbytext). -
ian-cox renamed this gist
Nov 28, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## Vimeo/Youtube kirbytag Kirbytext extension Place this php file in the site/plugins folder of your kirby install. The plugin strips the video id from the end of both Vimeo and Youtube links. -
ian-cox revised this gist
Nov 28, 2013 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # Vimeo/Youtube kirbytag Kirbytext extension Place this php file in the site/plugins folder of your kirby install. The plugin strips the video id from the end of both Vimeo and Youtube links. Use the kirby tag like this: - (video: vimeo.com/79338229) - (video: youtube.com/watch?v=0--NbrJX_xQ) - (video: youtu.be/0--NbrJX_xQ) -
ian-cox created this gist
Nov 28, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ <?php class kirbytextExtended extends kirbytext { function __construct($text, $markdown=true) { parent::__construct($text, $markdown); // define custom tags $this->addTags('video'); } function video($params) { if(str::contains($params['video'], "vimeo.com")):; //Get last 8 characters from vimeo url $vimeoid = substr( $params['video'], -8 ); //return embed code return '<div class="Flexible-container"><iframe src="http://player.vimeo.com/video/'. urlencode($vimeoid). '?title=0&byline=0&portrait=0&badge=0&color=808080" width="500" height="281" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div>'; elseif(str::contains($params['video'], "youtube.com") || str::contains($params['video'], "youtu.be")):; //Get last 11 characters from youtube url $youtubeid = substr( $params['video'], -11 ); //return embed code return '<div class="Flexible-container"><iframe width="560" height="315" src="//www.youtube.com/embed/'. $youtubeid .'" frameborder="0" allowfullscreen></iframe></div>'; endif; } } ?> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ /* Flexible iFrame CSS taken from Niklaus Gerber's Rapid Bootstrap V3 https://github.com/niklausgerber/Rapid-Bootstrap-V3 */ .Flexible-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .Flexible-container iframe{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; }