Importing into Kirby from Perch CMS

Yes, you can read all kinds of files and iterate over the data to create pages.
Say you export a CSV and turned the content into an array:

// simplified example
foreach($csv as $csvPage) {
  page('blog')->createChild([
    'slug' => Str::slug($csvPage['title']),
    'template' => 'post',
    'content'  => [
      'title' => $csvPage['title'],
      // all the fields...
    ]
  ])->changeStatus("listed", 0);
}

I tend to create an import route for this as it’s the easiest and fastest way.

2 Likes