Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require __DIR__ . '/kirby/bootstrap.php';
- // echo (new Kirby)->render();
- $items = page('blog')->children();
- foreach ($items as $item) {
- if ($i = $item->cover()->toFile()) {
- $i->update([
- 'template' => 'cover',
- ]);
- }
- foreach ($item->gallery()->split(',') as $image) {
- if ($i = $item->file($image)) {
- $i->update([
- 'template' => 'gallery',
- ]);
- }
- }
- $item->update([
- 'cover' => null,
- 'gallery' => null,
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement