Generate Dummy Content from Blueprints

The thing I miss every time I start a site with Kirby, is a way to create dummy content for testing.

With prototyping with systems like Jekyll or Harp or Mixture, you use JSON for the data and so can easily get dummy content (see json-generator or faker.js), and I have used these. But this way you build your markup twice: once for the prototype (using mustache or liquid templates) and then again in PHP — and then you still have to make some test data in Kirby later to make sure you did the back end right.

Kirby is so efficient to work with, it seems like you should be able to skip the prototype phase and build once; but there’s no way I know of to rapidly create dummy information for a flat-file CMS. Yet, we configure the Kirby Panel using blueprint files, which contain pretty much the same information you’d write for json-generator or faker.js. So what if we could use them to generate content? Since we define our content through the blueprints, we could also generate it from there. This is a perfect way to have content to build the front-end as well as to test the back-end (i.e. whether you’ve defined the blueprints correctly). It could be a standalone script, or a plug-in integration.

Anyway it’s an idea. I brought it up with @bastianallgeier a couple of years ago but I didn’t have the chops to build it then and still don’t. The discussions here seem to be thriving so I thought I’d throw it out there.

Just a quick FYI: you can find the code to read the blueprints properly in panel/app/lib/blueprint.php and panel/app/lib/blueprint/…. :+1:

I personally build plain HTML prototypes. It’s very easy to put the Kirby PHP code in afterwards by replacing the dummy content with PHP.

That’s an awesome workflow idea! :+1:

Yeah, a sort of combination of the subpage builder http://getkirby.com/docs/panel/blueprints/page-settings together with a script that generates some dummy content instead of empty files … :+1:

Ah yes, I’d forgotten about that. Yeah ideally it would be something that you’d execute in the Panel: at any given page click a button to generate child (sub) pages, it asks you which blueprint and how many instances you want, and bang.