4

Is it possible to create content types with Drush? Such as a new Galery content type?

I created a content type manually via web interface and checked the changes in database. However, there are quite a lot of changes - some changes are also in blob fields.

How do you do this?

3
  • why do you want to create contents types from drush?
    – saadlulu
    Jun 9, 2013 at 14:37
  • i dont think there's a direct command, you could probably do drush ev "node_type_save(array('type' => 'my type', 'name' => 'my type name'));" check api.drupal.org/api/drupal/modules%21node%21node.module/function/… for details
    – mojzis
    Jun 9, 2013 at 15:59
  • @saadlulu: For example I would want to create content types and fields with drush for fast prototyping a website.
    – LarS
    Aug 25, 2014 at 16:44

2 Answers 2

5

If you want to re-create content-types you have created in other drupal-installations you can use the features module:

This module allows you to export content-types to code (called features). Those features can be copied to other sites like normal modules and then be activated via drush using

drush en -y feature_name

1

In the drush docs I don't see anything like drush entitytype-bundle-create node foo but I do see drush field-create which is pretty cool.

http://www.drushcommands.com/drush-7x/field/field-create

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.