Воспользовался я этим мануалом http://www.drupal.ru/node/71971
Мне кажется или есть более простой способ добавлять и удалять, или только так как там описано?
Создаю я как то так
<?php
$test_type= node_type_set_defaults(array(
'type' => 'test',
'name' => 'тест',
'base' => 'node_content',
'description' => '',
'custom' => true,
'locked' => false,
'has_title' => true,
'title_label' => 'Название варианта ответа',
'comment' => false
));
node_type_save($test_type);
field_create_field(array(
'field_name' => 'quantity_selected',
'type' => 'text',
'settings' => array('max_length' => 60),
));
field_create_instance(array(
'entity_type' => 'node',
'bundle' => $test_type->type,
'field_name' => 'quantity_selected',
'label' => 'Количество',
'required' => TRUE,
'widget' => array('type' => 'textfield')
));
menu_rebuild();
?>
Комментарии
Это что такое?
<?php
variable_set('comment_test', '1');
variable_set('node_preview_test', 0);
variable_set('menu_options_test', array('user-menu'));?>
https://www.drupal.org/node/1169864