Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not maintained anymore. We joined forces with YAML content
The demo_content module lets you import demo content entities from YAML files. It has support for modules, profiles and themes. It can create and update any content entity types: nodes, blocks, files, images, taxonomy terms, menu links..etc.
See example module and theme: https://github.com/arshad/demo_content_examples
More examples
- Blocks: https://github.com/openrestaurant/openrestaurant/blob/8.x-2.x/themes/siz...
- Images: https://github.com/openrestaurant/openrestaurant/blob/8.x-2.x/themes/siz...
- Nodes with images: https://github.com/openrestaurant/openrestaurant/blob/8.x-2.x/themes/siz...
- Taxonomy terms: https://github.com/openrestaurant/openrestaurant/blob/8.x-2.x/themes/siz...
- Menu links: https://github.com/openrestaurant/openrestaurant/blob/8.x-2.x/themes/siz...
Usage
To add demo content to your module or theme, add the demo_content info to your .info.yaml
file. Example:
example.info.yml
name: 'Example Theme'
type: theme
description: 'Description for theme'
core: 8.x
version: 8.x-1.0-dev
demo_content:
- content/file.file.yml
- content/node.article.yml
Then create your demo content as follows:
file.file.yml
entity_type: file
bundle: file
content:
file_1:
uuid: 61bdc2a3-d56d-443f-8488-10ca4ab7b42a
path: $PATH$/images/wild.jpg
file_2:
uuid: 691b01e8-2af4-4b53-916d-f38033af5cb6
path: $PATH$/images/cacheme.jpg
node.article.yml
entity_type: node
bundle: article
content:
article_1:
uuid: 0f22e197-ada3-4833-911b-fb75dcbb0ff8
title: 'Lipsum dolor sit amet'
path_alias: '/lipsum-dolor'
body:
value: '<p>Lipsum dolor sit amet from dsadsa Demo Content.</p>'
format: full_html
field_image:
entity_type: file
uuid: 61bdc2a3-d56d-443f-8488-10ca4ab7b42a
You can also use the UI to import entities:
Roadmap
Batch for importing entities.- Add support for dependencies.
- Export entities feature.
- Add tests
Similar modules
Supporting organizations:
Project information
- Seeking new maintainer
The current maintainers are looking for new people to take ownership. - No further development
No longer developed by its maintainers. - Created by shadcn on , updated
- Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.