Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
default content system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2013 at 09:41 UTC
Updated:
1 Oct 2025 at 12:39 UTC
Jump to comment: Most recent
Comments
Comment #1
swentel commentedMore discussions over at #79582: Add example content to the experimental out-of-the-box demo install profile
Comment #2
larowlanNote https://github.com/larowlan/default_content
Comment #4
andypostComment #9
sluceroThe YAML Content module supports some of this approach as well.
https://www.drupal.org/project/yaml_content
The automatic installation of content with a module isn't implemented, but this could easily be added using available services through the install hook.
Comment #15
socialnicheguru commentedhttp://drupal.org/project/default_content
Comment #16
alexpottThe ability to create default content as part of installing things in Drupal has become an aim for #3274999: Distributions and Recipes initiative overview and roadmap therefore I think we should make this issue a part of it.
Comment #17
alexpottContrib has a pretty mature solution - the default content module but @larowlan wrote https://www.previousnext.com.au/blog/we-could-add-default-content-drupal... a while back about the issues.
I think we need to update the issue summary with steps we need to take to bring something like it into core. I feel the supporting the 2.x yaml file format would be a big boon as it would allow people to move from contrib to core with little change.
Comment #18
andypostDemo umami using migrations for initial content
Looks it's shortest route to reuse it
Also we using https://www.drupal.org/project/migrate_generator on custom projects
Comment #19
alexpott@andypost demo umami is not using migrate as far as I know. See \Drupal\demo_umami_content\InstallHelper - it's custom all the way down.
Comment #20
nedjoAs well as Default Content, some other similar modules in contrib (at varying levels of stability/completeness) are:
Comment #21
huzookaI also wrote a PoC module which exports the specified content into migrations: Entity Migrate Export
Comment #23
nerdsteinIt could be useful to identify code that is potentially reusable
Comment #24
nerdsteinQuick search on some prior art for default config
tests for "default config"
default config storage: DEFAULT_COLLECTION constant in the storage interface, used by the tests, seems to be relevant
Comment #25
pasqualleI would prefer a migrate based approach for default content.
Comment #26
nedjoThere seems to be a general consensus in this issue that we ought to base a solution on a relevant core API. The problem is, which one? We have at least three different solutions in core for the general problem of defining and installing/creating/importing an entity with its associated properties:
ConfigInstallerandConfigImporter.Choosing between them is not straightforward. What seems key is to first make sure we're clear on the spec.
There are at least three related use cases: importing, updating, and staging content. If all three are valid, we should build an API that, even if it doesn't immediately support all three, could do so in future.
Related:
Comment #27
marios anagnostopoulos commented@alexpott
I think that most of the issues that are mentioned in the Blog post you attached, have already been tackled one way or another in the default_content module.
@nedjo
I would not count REST and Migration as valid ways to have 'default' content.
In my understanding.. 'default' means demo content or content that you want to have tracked during development (Some basic pages / terms etc). I don't think that the default content aspect of drupal should handle massive numbers of imported entities. That is handled by migration :).
Comment #29
bsnodgrass commentedThis is a Roadmap ToDo Issue for Phase 1 of the Distributions and Recipes Initiative. Besides updating the Issue Summary, are there some child issues that should be created for this issue?
I am taking a first pass at some minor updates to the summary.
Reviewing a related docs https://git.drupalcode.org/project/distributions_recipes/-/blob/1.0.x/do..., I am creating an issue to remove "Deploying the content created by a Drupal recipe is out-of-scope." which conflicts with the project Roadmap.
Comment #30
wim leersRelated:
Comment #31
andypostIt still smells like experimental default content module in core so it's related in its queue #2849128: Add handling of ConfigEvent::IMPORT_MISSING_CONTENT
Comment #32
andypostPrimary blocker is found and fixed #3414993: Add ConfigImporter to \Drupal\Core\Config\Importer\MissingContentEvent
Comment #33
thejimbirch commentedWith the addition of the DefaultContent API in core as of 10.3, can this issue be closed?
https://www.drupal.org/node/3445169
Comment #34
andypostProbably better to re-purpose the issue to provide exporter as importer already in core
Comment #35
thejimbirch commentedComment #36
smustgrave commentedIf issue is re-purposed can the issue summary definitely be updated
Thanks.
Comment #37
andypostComment #38
thejimbirch commentedIn Drupal 11.3, we now have a content exporter!
`content:export` command added to help with recipe development
https://www.drupal.org/node/3533854
Thanks to all who helped move this along.