Skip to content

Instantly share code, notes, and snippets.

@Stolzenhain
Stolzenhain / kirby-group-files.php
Created June 22, 2016 10:10
Kirby CMS: Collect files sharing the same name / different extension for HTML5 Video handling
<?php
//build lookup array for files with the same name but a different extension
$fileGroups = [];
foreach($page->files() as $file) {
if (!isset($fileGroups[$file->name()])) {
$fileGroups[$file->name()] = [];
}
array_push($fileGroups[$file->name()], $file->extension());
}
@Stolzenhain
Stolzenhain / figure.php
Last active October 10, 2017 15:42
Modifications for Kirbytext images: Lazyloading via unveil.js, alternative caption method,ratio checker.
<?php
//overriding kirby image tag
// image tag
kirbytext::$tags['image'] = array(
'attr' => array(
'width',
'height',
'alt',