I want to easily be able to create 10-15 dummy blog articles to test out my pagination.
Are there any ways to currently do that?
I want to easily be able to create 10-15 dummy blog articles to test out my pagination.
Are there any ways to currently do that?
If you only need that few, you might as well copy and paste existing ones directly in the file system. Or create them manually in the Panel.
Other than that, you can of course create them programmatically via PHP with Kirby’s create()
method. Or use a bash script.
You can also create pages from a .csv file with the CSV handler
plugin.
How do I create them with the create() method?
This will create 15 pages with UID article-xx and title Article XX, no other content, template article:
<?php
$count = 15;
while ($count > 0) {
$data = array('title' => 'Article ' . $count);
$title = 'article-' . $count;
try {
$newPage = page('blog')->children()->create('article-' . $count, 'article', $data);
} catch(Exception $e) {
echo $e->getMessage();
}
$count--;
} ?>
https://getkirby.com/docs/cheatsheet/pages/create
If you want, you can extend this an add some more content fields with dummy content.