Ben install dosyasında hook_node_info yöntemini kullanarak, Drupal 7 özel bir düğüm türü yarattık:
// declare the new node type
function foo_node_info ( ) {
return array(
'foo' => array(
'name' => t('Foo entry'),
'base' => 'node_content',
'description' => t('For use to store foo entries.'),
));
} // END function foo_node_info
ve ben aşağıdaki kodu kullanarak modül dosya türünü kurtarmaya çalışıyorum:
// INSERT the stuff
node_save(node_submit((object)array(
'type' => 'foo',
'is_new' => true,
'uid' => 1,
'title' => 'Title, blah blah blah',
'url' => 'url here, just pretend',
'body' => '<p>test</p>',
)));
Benim sorun, url, ve vücut alanları tasarruf değil olmasıdır. Ben yanlış ne yapıyorum biliyor musun?