1

As part of Drupal 8 site install/deploy, I want to create content so that the site is functional and ready to use.

For example, whenever I install the site, there should be a home page node created.

How do I create content during site installation?

2
  • 1
    The best way is to create a profile install, here is an example of profile install come with drupal check core/profiles/demo_umami
    – berramou
    Commented May 1, 2020 at 23:14
  • Also have a look at hook_install_tasks to understand how you can create your own custom form, batch process or a callback function as part of your install process. api.drupal.org/api/drupal/…
    – Saw
    Commented May 2, 2020 at 4:30

1 Answer 1

2

There are few ways in Drupal 8 to manage site default content:

  1. Default content module allows to export/import content via drush and store the content in the structure similar to config in Drupal core.

  2. Umami profile in Drupal core has a custom importer which loads the content stored in CSV to be important as part of module install.

  3. Migrate CSV plugin allows to important the content from CSV using Drupal core migration API.

  4. Single File Components could be used to provide content with components.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.