Support default content entities

Created on 21 September 2013, about 11 years ago
Updated 29 June 2024, 5 months ago

Drupal has support for default config entities, but not for default content entities. As menu links are content entities, #2047633: Move definition of menu links to hook_menu_link_defaults(), decouple key name from path, and make 'parent' explicit β†’ tries to come up with a custom approach to define default links. As this is custom, we cannot use this for anything else. Contributes projects such as Devel and Commerce Kickstart already provide default content in D7, so it makes sense to provide a generic way to do this in Drupal.

Our roadmap doc identifies this issue as a ToDo for Phase 1.

Proposal

  • Store default content entities as YAML files in modules' /content directories.
  • Content entity type annotations get a content_prefix property of which the value maps to the YAML files, just like config_prefix does for config entities.
  • During installation the system scans for default content, turns them into entities and calls the save() method on them.

Next steps

  • Review and confirm the proposal
  • Cleanup docs
✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
default content systemΒ  β†’

Last updated 5 months ago

Created by

πŸ‡¬πŸ‡§United Kingdom Xano Southampton

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024