I have different content type in my site. For testing purpose, I want to add content to all content type form, but manually its not possible in such short term.
So, is any Drush command available to create node?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI have different content type in my site. For testing purpose, I want to add content to all content type form, but manually its not possible in such short term.
So, is any Drush command available to create node?
Just a note to point out a new module called Faker which can be used in conjunction with Devel Generate :
Use the PHP Faker library to generate more meaningful sample content.
Devel Generate is great for creating a lot of sample content in a hurry, but sometimes you want samples that are more meaningful, or closer to the content you expect users to generate. This is where Faker comes in.
Faker is a PHP library that generates fake data for you
Faker (the library) can generate real looking names, addresses, emails, domains and more. Faker (the module) combines the library with quick content creation abilities provided by Devel Generate, to give you the power to easily generate real looking sample content.
you can use devel generate module to generate content for testing purpose.Not sure this can be achieved using drush.
drush help generate-content
for details of the command.
There are drush genc
command, if you write drush help genc
you will see next thing.
Create content.
Arguments:
number_nodes Number of nodes to generate.
maximum_comments Maximum number of comments to generate.
Options:
--feedback An integer representing interval for insertion rate logging. Defaults to 500
--kill Delete all content before generating new content.
--languages A comma-separated list of language codes
--skip-fields A comma delimited list of fields to omit when generating random values
--types A comma delimited list of content types to create. Defaults to page,article.
So you can create nodes like drush genc 10
and also you can pass --types option(to create nodes of c.types you want). I guess you will need to install Devel module to use this command.
Try with drush generate-content
.