SHARE
TWEET

Untitled

a guest Jul 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require __DIR__ . '/kirby/bootstrap.php';
  4.  
  5. // echo (new Kirby)->render();
  6.  
  7. $items = page('blog')->children();
  8.  
  9. foreach ($items as $item) {
  10.     if ($i = $item->cover()->toFile()) {
  11.         $i->update([
  12.             'template' => 'cover',
  13.         ]);
  14.     }
  15.  
  16.     foreach ($item->gallery()->split(',') as $image) {
  17.         if ($i = $item->file($image)) {
  18.             $i->update([
  19.                 'template' => 'gallery',
  20.             ]);
  21.         }
  22.     }
  23.  
  24.     $item->update([
  25.         'cover' => null,
  26.         'gallery' => null,
  27.     ]);
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top