oliverdavies.uk/source/_daily_emails/2024-09-16.md
Oliver Davies 28014f4175 Add daily email for 2024-09-16
Experimenting with the Default Content module
2024-09-20 00:56:44 +01:00

33 lines
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Experimenting with the Default Content module
date: 2024-09-16
permalink: daily/2024/09/16/experimenting-with-the-default-content-module
tags:
- software-development
- drupal
- drupal-modules
- php
cta: ~
snippet: |
I've recently been experimenting with the Default Content module.
drupal_planet: true
---
I recently sent a database to a client whose new Drupal website I'm building.
I'd populated it with some default users, nodes and menu links that they'd be able to review after they import the database into their hosting.
That worked well, but I've also recently been using the [Default Content module][0] which exports entities into YAML and saves them as code alongside the configuration.
Now I can install the website from scratch using the exported configuration to re-add the content types, block types, etc, and by enabling a custom module, all the default content will also be recreated.
I can tear the site down now and rebuild it as often as I like and avoid contaminating my environment with any rogue configuration or content changes.
Everything is reproducible.
I also wouldn't have needed to send the database to the client. They could have installed Drupal and followed the same steps I would do locally and got exactly the same result.
I like this approach and can see me using it more on future projects.
[0]: https://www.drupal.org/project/default_content