Codepen extension for Kirby 2 (fork of Kirbytext Codepen tag by ClementRoy)
This extension for Kirby 2 enables you to easily embed CodePen ‘Pens’ into your sites pages.
(codepen: http://codepen.io/chriscoyier/pen/oqHlh/)
Kirby 2 allows Kirbytext (Kirbys custom implementation of Mark Down) to be extended with custom ‘Kirbytags’. More about Kirbytags.
Sorry, not backwards compatible with Kirby 1. Kirbytext Codepen tag by ClementRoy is compatible.
Place codepen.php
in your /site/tags/
folder, or create a ‘tags’ folder inside your site folder if one is not there.
Now in your content text files you can now use the new codepen tag:
(codepen: http://codepen.io/chriscoyier/pen/oqHlh/)
This will embed the specified Pen using a default height and styled with the standard CodePen embed theme.
You can supply additional parameters in the tag to override the height (500 = 500px height embed) or type (html, css result displayed).
(codepen: http://codepen.io/chriscoyier/pen/oqHlh/ height: 250 type: html)
If you are a CodePen user, pen themes enable you to create a theme style for your embedded Pens.
To change from the default CodePen theme to your personal embed theme, open site/tags/codepen.php
and edit the $theme = '';
value, to your theme (data-theme-id) value.
Note: Amending this value will change the theme of ALL your CodePen embeds using this Kirby extension.
If $theme
value not edited, CodePen embeds will use the default CodePen theme style.