Hi guys,

I searched around in documentation and haven't found a clue so far : Is there a way to create sample content upon theme install ?

I managed to create a content type itself and a custom block too but I would like to add, when installing the theme, a sample content of each to demonstrate what it looks like once theme installed. Up to the end user to modify or delete it.

Thx

Comments

ressa’s picture

You can do this with Drush and Devel. Install and enable:

composer require -n drush/drush drupal/devel
drush en devel devel_generate -y

Generate 50 nodes of random content type
drush devel-generate:content

Generate 20 nodes of content type "Song"
drush devel-generate:content --bundles=song 20

Civette’s picture

Thx for feedback but this is not really the purpose. Idea is to have a single content created upon theme install to provide visual guidance to final user.... kind of a placeholder text.  Adding an additional module would be overkill.