first version
This commit is contained in:
16
site/plugins/gallery/index.php
Executable file
16
site/plugins/gallery/index.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
Kirby::plugin('starterkit/gallery', [
|
||||
'hooks' => [
|
||||
'kirbytags:after' => function ($text, $data, $options) {
|
||||
|
||||
if ($page = $data['parent']->gallery()->toPage()) {
|
||||
$gallery = snippet('gallery', ['gallery' => $page], true);
|
||||
} else {
|
||||
$gallery = '';
|
||||
}
|
||||
|
||||
return str_replace('{{ gallery }}', $gallery, $text);
|
||||
}
|
||||
]
|
||||
]);
|
Reference in New Issue
Block a user